private void OnThemeRadioButtonChecked(object sender, RoutedEventArgs e) { var selectedTheme = ((RadioButton)sender)?.Tag?.ToString(); ApplicationViewTitleBar titleBar = ApplicationView.GetForCurrentView().TitleBar; if (selectedTheme != null) { App.RootTheme = App.GetEnum <ElementTheme>(selectedTheme); if (selectedTheme == "Dark") { titleBar.ButtonForegroundColor = Colors.White; } else if (selectedTheme == "Light") { titleBar.ButtonForegroundColor = Colors.Black; } else { if (Application.Current.RequestedTheme == ApplicationTheme.Dark) { titleBar.ButtonForegroundColor = Colors.White; } else { titleBar.ButtonForegroundColor = Colors.Black; } } } }
private void OnThemeRadioButtonChecked(object sender, RoutedEventArgs e) { var selectedTheme = ((RadioButton)sender)?.Tag?.ToString(); if (selectedTheme != null) { App.RootTheme = App.GetEnum <ElementTheme>(selectedTheme); } }
private void OnThemeRadioButtonChecked(object sender, RoutedEventArgs e) { var selectedTheme = ((RadioButton)sender)?.Tag?.ToString(); ApplicationViewTitleBar titleBar = ApplicationView.GetForCurrentView().TitleBar; if (selectedTheme != null) { ThemeHelper.RootTheme = App.GetEnum <ElementTheme>(selectedTheme); } }