private async void MainWindow_OnLoaded(object sender, RoutedEventArgs e) { ThemeSetterManager.SetThemeSelectedThemes(); UpdateHelpers.OnAutoUpdate = () => { this.Dispatcher.Invoke(() => { var nhmUpdaterDialog = new CustomDialog() { Title = Translations.Tr("NiceHash Miner Starting Update"), Description = Translations.Tr("NiceHash Miner auto updater in progress."), OkText = Translations.Tr("OK"), CancelVisible = Visibility.Collapsed, OkVisible = Visibility.Collapsed, AnimationVisible = Visibility.Visible }; ShowContentAsModalDialog(nhmUpdaterDialog); }); }; await MainWindow_OnLoadedTask(); _vm.GUISettings.PropertyChanged += GUISettings_PropertyChanged; NotificationsManager.Instance.PropertyChanged += Instance_PropertyChanged; MiningState.Instance.PropertyChanged += MiningStateInstance_PropertyChanged; SetNotificationCount(NotificationsManager.Instance.NotificationNewCount); }
public Dashboard() { InitializeComponent(); DataContextChanged += Dashboard_DataContextChanged; ThemeSetterManager.AddThemeSetter(this); }
private void SetTheme(bool isLight) { var displayTheme = isLight ? "Light" : "Dark"; GUISettings.Instance.DisplayTheme = displayTheme; ThemeSetterManager.SetTheme(isLight); if (_gotQRCode) { var(image, ok) = QrCodeImageGenerator.GetQRCodeImage(_uuid, isLight); if (ok) { rect_qrCode.Fill = image; } } }
private async void MainWindow_OnLoaded(object sender, RoutedEventArgs e) { ThemeSetterManager.SetThemeSelectedThemes(); UpdateHelpers.OnAutoUpdate = () => { this.Dispatcher.Invoke(() => { var nhmUpdaterDialog = new CustomDialog() { Title = Translations.Tr("NiceHash Miner Starting Update"), Description = Translations.Tr("NiceHash Miner auto updater in progress."), OkText = Translations.Tr("OK"), CancelVisible = Visibility.Collapsed, OkVisible = Visibility.Collapsed, AnimationVisible = Visibility.Visible, ExitVisible = Visibility.Collapsed }; ShowContentAsModalDialog(nhmUpdaterDialog); }); }; await MainWindow_OnLoadedTask(); _vm.GUISettings.PropertyChanged += GUISettings_PropertyChanged; NotificationsManager.Instance.PropertyChanged += Instance_PropertyChanged; MiningState.Instance.PropertyChanged += MiningStateInstance_PropertyChanged; SetNotificationCount(NotificationsManager.Instance.NotificationNewCount); if (!HasWriteAccessToFolder(Paths.Root)) { this.Dispatcher.Invoke(() => { var nhmNoPermissions = new CustomDialog() { Title = Translations.Tr("Folder lacks permissions"), Description = Translations.Tr("NiceHash Miner folder doesn't have write access. This can prevent some features from working."), OkText = Translations.Tr("OK"), CancelVisible = Visibility.Collapsed, OkVisible = Visibility.Visible, AnimationVisible = Visibility.Collapsed }; ShowContentAsModalDialog(nhmNoPermissions); }); } }
public BaseDialogWindow() { double currentDPIScaleFactor = (double)SystemHelper.GetCurrentDPIScaleFactor(); Screen screen = Screen.FromHandle((new WindowInteropHelper(this)).Handle); base.SizeChanged += new SizeChangedEventHandler(this.OnSizeChanged); base.StateChanged += new EventHandler(this.OnStateChanged); base.Loaded += new RoutedEventHandler(this.OnLoaded); Rectangle workingArea = screen.WorkingArea; base.MaxHeight = (double)(workingArea.Height + 16) / currentDPIScaleFactor; SystemEvents.DisplaySettingsChanged += new EventHandler(this.SystemEvents_DisplaySettingsChanged); this.AddHandler(Window.MouseLeftButtonUpEvent, new MouseButtonEventHandler(this.OnMouseButtonUp), true); this.AddHandler(Window.MouseMoveEvent, new System.Windows.Input.MouseEventHandler(this.OnMouseMove)); // extra loaded/closing stuff base.Loaded += new RoutedEventHandler(this.OnLoadedSetRender); base.Closing += new CancelEventHandler(this.OnWindowClosing); ThemeSetterManager.AddThemeSetter(this); }
private void CheckBoxMode_Unchecked(object sender, RoutedEventArgs e) { GUISettings.Instance.DisplayTheme = "Light"; ThemeSetterManager.SetTheme(true); rect_qrCode.Fill = QrCodeHelpers.GetQRCode(_uuid); }
private void CheckBoxMode_Unchecked(object sender, RoutedEventArgs e) { GUISettings.Instance.DisplayTheme = "Light"; ThemeSetterManager.SetTheme(true); }
private void CheckBoxMode_Checked(object sender, RoutedEventArgs e) { GUISettings.Instance.DisplayTheme = "Dark"; ThemeSetterManager.SetTheme(false); }
public PluginIcon() { InitializeComponent(); ThemeSetterManager.AddThemeSetter(this); }