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(); }
private static void changeTheme(AppTheme theme) { ThemeManager.ChangeAppStyle(Application.Current, ThemeManager .GetAccent(AppColors .CurrentAppAccent.ToString()), ThemeManager .GetAppTheme(theme.ToString())); }
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(); }
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); } }
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(); }
public static string CovertAppThemeToString(AppTheme appTheme) { return("Base" + appTheme.ToString()); }
/// <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())); }
void OnRequestedThemeChanged(object sender, AppThemeChangedEventArgs e) { AppTheme requestedTheme = e.RequestedTheme; ThemeLabel.Text = requestedTheme.ToString(); }