xamarin.ios - Monotouch - Use of Application class as storage of common objects -


to communicate between views , objects persistant information, example username , choice of font size display, considered form put these onto application object, or more efficient put them static singletons?

for example:

public class application     {         static void main (string[] args)         {             uiapplication.main (args);         }          public static username {get;set;}     } 

i don't think there's difference performance-wise between putting static objects application vs singletons vs static classes.

for things colors , fonts, prefer create static classes hold each type of object, example write this:

public static class colors {     public static color toolbarcolor = color.black;     .. } 

this makes easier change colors around entire app without having searching around everywhere. same thing fonts, images, etc.


Comments

Popular posts from this blog

asp.net - repeatedly call AddImageUrl(url) to assemble pdf document -

java - Android recognize cell phone with keyboard or not? -

iphone - How would you achieve a LED Scrolling effect? -