private async void ThemeSettingsService_OnBackgroundChanged(object sender, Brush backgroundBrush) { await ThreadUtility.CallOnUIThreadAsync(Dispatcher, () => { RootGrid.Background = backgroundBrush; }); }
private async void ThemeSettingsService_OnThemeChanged(object sender, ElementTheme theme) { await ThreadUtility.CallOnUIThreadAsync(Dispatcher, () => { SetAppIconBasedOnTheme(theme); }); }
private async void ThemeSettingsService_OnThemeChanged(object sender, EventArgs args) { await ThreadUtility.CallOnUIThreadAsync(Window.Current?.Dispatcher ?? Dispatcher, () => { ThemeSettingsService.SetRequestedTheme(null, Window.Current.Content, null, Application.Current.RequestedTheme); }); }
private async void ThemeSettingsService_OnThemeChanged(object sender, EventArgs args) { await ThreadUtility.CallOnUIThreadAsync(Dispatcher, () => { ThemeSettingsService.SetRequestedTheme(RootGrid, Window.Current.Content, ApplicationView.GetForCurrentView().TitleBar, Application.Current.RequestedTheme); }); }
private async void ThemeSettingsService_OnAccentColorChanged(object sender, Color color) { await ThreadUtility.CallOnUIThreadAsync(Dispatcher, () => { SetSelectionHighlightColor(color); }); }
private async void ThemeSettingsService_OnAccentColorChanged(object sender, Color color) { await ThreadUtility.CallOnUIThreadAsync(Dispatcher, () => { LeftBox.SelectionHighlightColor = new SolidColorBrush(color); RightBox.SelectionHighlightColor = new SolidColorBrush(color); }); }
private async void ThemeSettingsService_OnAccentColorChanged(object sender, Color color) { await ThreadUtility.CallOnUIThreadAsync(Dispatcher, () => { LeftBox.SelectionHighlightColor = Application.Current.Resources["SystemControlForegroundAccentBrush"] as SolidColorBrush; RightBox.SelectionHighlightColor = Application.Current.Resources["SystemControlForegroundAccentBrush"] as SolidColorBrush; }); }
private async void UISettings_AdvancedEffectsEnabledChanged(UISettings sender, object args) { await ThreadUtility.CallOnUIThreadAsync(Dispatcher, () => { BackgroundTintOpacitySlider.IsEnabled = UISettings.AdvancedEffectsEnabled && PowerManager.EnergySaverStatus != EnergySaverStatus.On; }); }
private async void ThemeSettingsService_OnThemeChanged(object sender, EventArgs args) { await ThreadUtility.CallOnUIThreadAsync(Dispatcher, () => { SetAppIconBasedOnTheme(ThemeSettingsService.UseWindowsTheme ? ThemeSettingsService.ApplicationThemeToElementTheme(Application.Current.RequestedTheme) : ThemeSettingsService.ThemeMode); }); }
private async void OnStatusBarVisibilityChanged(object sender, bool visible) { await ThreadUtility.CallOnUIThreadAsync(Dispatcher, () => { if (ApplicationView.GetForCurrentView().ViewMode != ApplicationViewMode.CompactOverlay) { ShowHideStatusBar(visible); } }); }
private async void ThemeSettingsService_OnAccentColorChanged(object sender, Color color) { await ThreadUtility.CallOnUIThreadAsync(Dispatcher, () => { BackgroundTintOpacitySlider.Foreground = new SolidColorBrush(color); AccentColorPicker.ColorChanged -= AccentColorPicker_OnColorChanged; AccentColorPicker.Color = color; AccentColorPicker.ColorChanged += AccentColorPicker_OnColorChanged; }); }
private async void ThemeSettingsService_OnAccentColorChanged(object sender, Color color) { await ThreadUtility.CallOnUIThreadAsync(_dispatcher, () => { if (Sets.Items == null) { return; } foreach (SetsViewItem item in Sets.Items) { item.Icon.Foreground = Application.Current.Resources["SystemControlForegroundAccentBrush"] as SolidColorBrush; item.SelectionIndicatorForeground = Application.Current.Resources["SystemControlForegroundAccentBrush"] as SolidColorBrush; } }); }
private async void ThemeSettingsService_OnAccentColorChanged(object sender, Color color) { await ThreadUtility.CallOnUIThreadAsync(_dispatcher, () => { if (Sets.Items == null) { return; } foreach (SetsViewItem item in Sets.Items) { item.Icon.Foreground = new SolidColorBrush(color); item.SelectionIndicatorForeground = new SolidColorBrush(color); } }); }
private async void ThemeSettingsService_OnAccentColorChanged(object sender, Color color) { await ThreadUtility.CallOnUIThreadAsync(Dispatcher, ThemeSettingsService.SetRequestedAccentColor); }
public NotepadsMainPage() { InitializeComponent(); _defaultNewFileName = _resourceLoader.GetString("TextEditor_DefaultNewFileName"); NotificationCenter.Instance.SetNotificationDelegate(this); // Setup theme ThemeSettingsService.SetRequestedTheme(RootGrid, Window.Current.Content, ApplicationView.GetForCurrentView().TitleBar, Application.Current.RequestedTheme); ThemeSettingsService.OnBackgroundChanged += ThemeSettingsService_OnBackgroundChanged; ThemeSettingsService.OnThemeChanged += ThemeSettingsService_OnThemeChanged; ThemeSettingsService.OnAccentColorChanged += ThemeSettingsService_OnAccentColorChanged; // Setup custom Title Bar Window.Current.SetTitleBar(AppTitleBar); // Setup status bar ShowHideStatusBar(EditorSettingsService.ShowStatusBar); EditorSettingsService.OnStatusBarVisibilityChanged += async(sender, visibility) => { await ThreadUtility.CallOnUIThreadAsync(Dispatcher, () => { if (ApplicationView.GetForCurrentView().ViewMode != ApplicationViewMode.CompactOverlay) { ShowHideStatusBar(visibility); } }); }; // Session backup and restore toggle EditorSettingsService.OnSessionBackupAndRestoreOptionChanged += async(sender, isSessionBackupAndRestoreEnabled) => { await ThreadUtility.CallOnUIThreadAsync(Dispatcher, async() => { if (isSessionBackupAndRestoreEnabled) { SessionManager.IsBackupEnabled = true; SessionManager.StartSessionBackup(startImmediately: true); } else { SessionManager.IsBackupEnabled = false; SessionManager.StopSessionBackup(); await SessionManager.ClearSessionDataAsync(); } }); }; // Sharing Windows.ApplicationModel.DataTransfer.DataTransferManager.GetForCurrentView().DataRequested += MainPage_DataRequested; Windows.UI.Core.Preview.SystemNavigationManagerPreview.GetForCurrentView().CloseRequested += MainPage_CloseRequested; if (App.IsGameBarWidget) { TitleBarReservedArea.Width = .0f; } else { Window.Current.SizeChanged += WindowSizeChanged; Window.Current.VisibilityChanged += WindowVisibilityChangedEventHandler; } InitControls(); // Init shortcuts _keyboardCommandHandler = GetKeyboardCommandHandler(); //Register for printing if (!PrintManager.IsSupported()) { MenuPrintButton.Visibility = Visibility.Collapsed; MenuPrintAllButton.Visibility = Visibility.Collapsed; MenuPrintSeparator.Visibility = Visibility.Collapsed; } else { PrintArgs.RegisterForPrinting(this); } }