/// <summary> /// Evento para trocar a aparência do app de acordo com o estado deste /// </summary> /// <param name="sender">Objeto sender</param> /// <param name="e">Parâmetro e</param> private void App_RequestedThemeChanged(object sender, AppThemeChangedEventArgs e) { MainThread.BeginInvokeOnMainThread(() => { AparenciaHelper.AplicarAparencia(); }); }
private void App_RequestedThemeChanged(object sender, AppThemeChangedEventArgs e) { int themeRequested = (int)e.RequestedTheme; Preferences.Set(Constants.Preferences.Settings.Theme, themeRequested); SetTheme(); }
private void Current_RequestedThemeChanged(object sender, AppThemeChangedEventArgs e) { var darkColor = (Color)Application.Current.Resources["SecondaryDarkMainColor"]; var lightColor = (Color)Application.Current.Resources["SecondaryLightMainColor"]; StatusBar.SetStatusBarColor(e.RequestedTheme == OSAppTheme.Dark ? darkColor : lightColor); }
private void App_RequestedThemeChanged(object sender, AppThemeChangedEventArgs e) { MainThread.BeginInvokeOnMainThread(() => { TheTheme.SetTheme(); }); }
private void OnRequestedThemeChanged(object sender, AppThemeChangedEventArgs e) { DebugPage.WriteLine($"Theme changed on {GetType().Name} to: {e.RequestedTheme}"); // Re-render UI when app theme changes between dark/light StateHasChanged(); }
private void HandleRequestedThemeChanged(object sender, AppThemeChangedEventArgs e) { if (e.RequestedTheme != _currentTheme) { _currentTheme = e.RequestedTheme; SetTheme(_currentTheme); } }
void OnRequestedThemeChanged(object sender, AppThemeChangedEventArgs e) { string requestedTheme = $"{_count}: {e.RequestedTheme}"; Debug.WriteLine(requestedTheme); _themes.Text += requestedTheme + Environment.NewLine; _count++; }
private void ApplicationRequestedThemeChanged(object sender, AppThemeChangedEventArgs e) { var applicationStateService = DependencyService.Get <IApplicationStateService>(); if (!applicationStateService.IsApplicationActive) { return; } this.CanChangeTheme = this.control.IsThemable && Xamarin.Forms.Application.Current.RequestedTheme != OSAppTheme.Dark; }
/// <summary> /// Reponsible to persist the theme selected by user. /// </summary> /// <param name="theme">Theme selected by user.</param> public void PersistApplicationTheme(string theme) { Properties.Settings.Default.Theme = theme; Properties.Settings.Default.Save(); AppThemeChangedEventArgs eventArgs = new AppThemeChangedEventArgs() { SelectedTheme = theme }; this.AppThemeChanged(this, eventArgs); }
private void OnRequestedThemeChanged(object sender, AppThemeChangedEventArgs e) { Xamarin.Forms.Application.Current.RequestedThemeChanged -= this.OnRequestedThemeChanged; var theme = Xamarin.Forms.Application.Current.UserAppTheme; if (theme == OSAppTheme.Unspecified) { AppCompatDelegate.DefaultNightMode = AppCompatDelegate.ModeNightUnspecified; } else { AppCompatDelegate.DefaultNightMode = theme == OSAppTheme.Dark ? AppCompatDelegate.ModeNightYes : AppCompatDelegate.ModeNightNo; } }
private void Current_RequestedThemeChanged(object sender, AppThemeChangedEventArgs e) { switch (e.RequestedTheme) { case OSAppTheme.Unspecified: break; case OSAppTheme.Light: break; case OSAppTheme.Dark: break; default: break; } }
void OnRequestedThemeChanged(object sender, AppThemeChangedEventArgs e) { ResourceDictionary previousTheme, currentTheme; if (e.RequestedTheme == OSAppTheme.Dark) { previousTheme = _lightTheme; currentTheme = _darkTheme; } else { previousTheme = _darkTheme; currentTheme = _lightTheme; } var mergedDictionaries = Resources.MergedDictionaries; mergedDictionaries.Remove(previousTheme); mergedDictionaries.Add(currentTheme); }
private void App_RequestedThemeChanged(object sender, AppThemeChangedEventArgs e) { var mergedDictionaries = Current.Resources.MergedDictionaries; if (mergedDictionaries != null) { mergedDictionaries.Clear(); switch (e.RequestedTheme) { case OSAppTheme.Light: mergedDictionaries.Add(new Light()); break; case OSAppTheme.Dark: default: mergedDictionaries.Add(new Dark()); break; } } }
private void OnRequestedThemeChanged(object sender, AppThemeChangedEventArgs e) { if (UIApplication.SharedApplication.ApplicationState == UIApplicationState.Background) { return; } var theme = Xamarin.Forms.Application.Current.UserAppTheme; if (theme == OSAppTheme.Unspecified) { this.Window.OverrideUserInterfaceStyle = UIUserInterfaceStyle.Unspecified; } else { this.Window.OverrideUserInterfaceStyle = theme == OSAppTheme.Dark ? UIUserInterfaceStyle.Dark : UIUserInterfaceStyle.Light; } if (Xamarin.Forms.Application.Current.RequestedTheme == OSAppTheme.Dark) { this.SetControlsDefaultTheme(); } }
private void Current_RequestedThemeChanged(object sender, AppThemeChangedEventArgs e) { ((MainPage)MainPage).ThemeUpdates.Add($"{num}: {e.RequestedTheme}"); num++; }
void ThemeChanged(object sender, AppThemeChangedEventArgs e) => ChangeTheme(e.RequestedTheme);
void HandleThemeChanged(object sender, AppThemeChangedEventArgs e) => SetOnboardingItems();
private void Current_RequestedThemeChanged(object sender, AppThemeChangedEventArgs e) { _currentThemeLabel.Text = Application.Current.RequestedTheme.ToString(); }
void RequestedThemeChanged(object sender, AppThemeChangedEventArgs e) { Value = GetValue(); }
internal void ThemeChanged(object sender, AppThemeChangedEventArgs e) { OnThemeChanged(e.RequestedTheme); }
void OnRequestedThemeChanged(object sender, AppThemeChangedEventArgs e) { AppTheme requestedTheme = e.RequestedTheme; ThemeLabel.Text = requestedTheme.ToString(); }
private void App_RequestedThemeChanged(object sender, AppThemeChangedEventArgs e) { Debug.WriteLine($"Requested: {e.RequestedTheme}"); }
private void HandleAppThemeChanged(object sender, AppThemeChangedEventArgs e) { this.SetupApplicationTheme(); }
private void OnCurrentRequestedThemeChanged(object sender, AppThemeChangedEventArgs e) { RaisePropertyChanged(nameof(Theme)); }
private void OnRequestedThemeChanged(object sender, AppThemeChangedEventArgs e) { this.Window.OverrideUserInterfaceStyle = UIUserInterfaceStyle.Light; }
private void App_RequestedThemeChanged(object sender, AppThemeChangedEventArgs e) { SwitchTheme(e.RequestedTheme); }
private void Current_RequestedThemeChanged(object sender, AppThemeChangedEventArgs e) { App.Current.MainPage.DisplayAlert("App Alert", App.Current.UserAppTheme.ToString(), "ok"); }
private void Current_RequestedThemeChanged(object sender, AppThemeChangedEventArgs e) { Task.Run(new Action(loadCategories)); }
private void Current_RequestedThemeChanged(object sender, AppThemeChangedEventArgs e) { SentrySdk.AddBreadcrumb(e.RequestedTheme.ToString(), "AppTheme.Change", level: BreadcrumbLevel.Info); }
private void Current_RequestedThemeChanged(object sender, AppThemeChangedEventArgs e) { App.Current.UserAppTheme = e.RequestedTheme; }