Beispiel #1
0
        public App()
        {
            UnityContainer unityContainer = new UnityContainer();

            unityContainer.RegisterSingleton <AppSettingsController>();
            unityContainer.RegisterSingleton <AppLanguageController>();
            unityContainer.RegisterSingleton <IContentProvider, AppNetworkContentProvider>();
            ServiceLocator.SetLocatorProvider(() => new UnityServiceLocator(unityContainer));
            InitializeComponent();

            AppLanguageController appLanguage     = ServiceLocator.Current.GetInstance <AppLanguageController>();
            IContentProvider      contentProvider = ServiceLocator.Current.GetInstance <IContentProvider>();



            if (!appLanguage.SupportedLanguages.ContainsKey
                    (CultureInfo.CurrentCulture.Name.ToLower()))
            {
                Localizer.CultureStringOverride =
                    appLanguage.SupportedLanguages.Keys.First();
                appLanguage.CurrentLanguage = appLanguage.
                                              SupportedLanguages[appLanguage.SupportedLanguages.Keys.First()];
            }
            {
                appLanguage.CurrentLanguage = appLanguage.
                                              SupportedLanguages[CultureInfo.CurrentCulture.Name.ToLower()];
            }
            Task.WaitAll(Localizer.LoadDictionary());

            MainPage = new MainPage();
        }
 public MainMapViewModel(AppLanguageController appLenguageProvider)
 {
     Title                = Localizer.GetString("MapTitle");
     MapSupportTitle      = Localizer.GetString("MapSupportTitle");
     SupportTitalFontSize = defaultMapTitleSize;
     FontColor            = defaultColor;
     BackgroundColor      = backgroundColor;
 }
 public SettingsViewModel(AppLanguageController appLanguageProvider)
 {
     UpdateLanguage();
     SettingsLabelsFontSize = defaultSize;
     SupportTitalFontSize   = defaultSupportTitleSize;
     FontColor          = defaultColor;
     BackgroundColor    = backgroundColor;
     SupportedLanguages = new List <string>(appLanguageProvider.SupportedLanguages.Values);
     SelectedLanguage   = appLanguageProvider.CurrentLanguage;
 }