public static async void ChangeTheme(AppTheme newAppTheme)
        {
            switch (newAppTheme)
            {
            case AppTheme.Donker:
                App.Current.Resources["backgroundColor"] = Color.FromHex("#212121");
                App.Current.Resources["lineTextColor"]   = Color.White;
                App.Current.Resources["tabBarColor"]     = Color.FromHex("#464448");
                break;

            case AppTheme.Licht:
                App.Current.Resources["backgroundColor"] = Color.FromHex("#B2DFDB");
                App.Current.Resources["lineTextColor"]   = Color.Black;
                App.Current.Resources["tabBarColor"]     = Color.FromHex("#E0F2F1");
                break;

            default:
                break;
            }

            App.Preferences.AppTheme = newAppTheme;
            await App.Database.SavePreferencesAsync(App.Preferences);

            AppThemePickerVar.SelectedItem = newAppTheme.ToString();
        }
Exemplo n.º 2
0
 private static void changeTheme(AppTheme theme)
 {
     ThemeManager.ChangeAppStyle(Application.Current,
                                 ThemeManager
                                 .GetAccent(AppColors
                                            .CurrentAppAccent.ToString()),
                                 ThemeManager
                                 .GetAppTheme(theme.ToString()));
 }
Exemplo n.º 3
0
        public void SetTheme(AppTheme theme)
        {
            if (theme == AppTheme.Default)
            {
                ThemeManager.Current.ThemeSyncMode = ThemeSyncMode.SyncAll;
                ThemeManager.Current.SyncTheme();
            }
            else
            {
                ThemeManager.Current.ThemeSyncMode = ThemeSyncMode.SyncWithHighContrast;
                ThemeManager.Current.SyncTheme();
                ThemeManager.Current.ChangeTheme(Application.Current, $"{theme}.Blue", SystemParameters.HighContrast);
            }

            App.Current.Properties["Theme"] = theme.ToString();
        }
Exemplo n.º 4
0
 private static void changeTheme(AppTheme theme)
 {
     try
     {
         ThemeManager.ChangeAppStyle(Application.Current,
                                     ThemeManager
                                     .GetAccent(AppColors
                                                .CurrentAppAccent.ToString()),
                                     ThemeManager
                                     .GetAppTheme(theme.ToString()));
     }
     catch (Exception ex)
     {
         App.SendException(ex);
     }
 }
Exemplo n.º 5
0
        public void SetTheme(AppTheme theme)
        {
            if (theme == AppTheme.Default)
            {
                ThemeManager.Current.ThemeSyncMode = ThemeSyncMode.SyncAll;
                ThemeManager.Current.SyncTheme();
            }
            else
            {
                ThemeManager.Current.ThemeSyncMode = ThemeSyncMode.SyncWithHighContrast;
                ThemeManager.Current.SyncTheme();
                // ThemeManager.Current.ChangeThemeBaseColor(Application.Current, theme.ToString());
                ThemeManager.Current.ChangeTheme(Application.Current, $"{theme}.Blue", IsHighContrastActive);
            }

            App.Current.Properties["Theme"] = theme.ToString();
        }
Exemplo n.º 6
0
 public static string CovertAppThemeToString(AppTheme appTheme)
 {
     return("Base" + appTheme.ToString());
 }
Exemplo n.º 7
0
 /// <summary>
 /// Method to translate <see cref="AppTheme"/>.
 /// </summary>
 /// <param name="appTheme"><see cref="AppTheme"/>.</param>
 /// <returns>Translated <see cref="AppTheme"/>.</returns>
 public string Translate(AppTheme appTheme)
 {
     return(Translate(appTheme.ToString()));
 }
Exemplo n.º 8
0
        void OnRequestedThemeChanged(object sender, AppThemeChangedEventArgs e)
        {
            AppTheme requestedTheme = e.RequestedTheme;

            ThemeLabel.Text = requestedTheme.ToString();
        }