protected override void OnSourceInitialized(EventArgs e) { base.OnSourceInitialized(e); NativeMethods.DisableMinMaxButton(this); #if NET45_OR_GREATER if (App.Skin == Skin.Dark) { var helper = new WindowInteropHelper(this); helper.EnsureHandle(); DarkModeHelper.UseImmersiveDarkMode(helper.Handle, true); } #endif }
private void DarkMode_Menu_AddItem(ContextMenu c, DarkMode mode) { MenuItem m = new MenuItem(); m.Header = mode.GetDescription(); m.Click += delegate { DarkModeSelect.TextDetail = mode.GetDescription(); Properties.Settings.Default.DarkMode2 = mode; Properties.Settings.Default.Save(); DarkModeHelper.Update(); }; m.Style = (Style)FindResource("MenuItemStyle"); c.Items.Add(m); }
private void Tray_OnTrayLeftMouseDown(object sender, RoutedEventArgs e) { DarkModeHelper.Update(); Visibility = Visibility == Visibility.Visible ? Visibility.Collapsed : Visibility.Visible; if (Visibility == Visibility.Visible) { if (WindowState == WindowState.Minimized) { WindowState = WindowState.Normal; } Activate(); Topmost = true; Topmost = false; Focus(); Show(); } }
private void DarkMode_Menu_AddItem(ContextMenu c, DarkMode mode) { MenuItem m = new MenuItem(); m.Header = mode.GetDescription(); m.Click += delegate { DarkModeSelect.TextDetail = mode.GetDescription(); Properties.Settings.Default.DarkMode2 = mode; Properties.Settings.Default.Save(); DarkModeHelper.Update(); if (BluetoothService.Instance.IsConnected) { BluetoothService.Instance.SendAsync(SPPMessageBuilder.Info.GetAllData()); } }; m.Style = (Style)FindResource("MenuItemStyle"); c.Items.Add(m); }
private void DarkMode_OnSwitchToggled(object sender, bool e) { DarkModeHelper.SetState(e); Properties.Settings.Default.DarkMode = e; Properties.Settings.Default.Save(); }
public MainWindow() { if (Settings.Default.DarkMode2 == DarkMode.Unset) { Settings.Default.DarkMode2 = (DarkMode)Convert.ToInt32(Settings.Default.DarkMode); Settings.Default.Save(); } DarkModeHelper.Update(); _mainPage = new MainPage(this); _systemPage = new SystemPage(this); _selfTestPage = new SelfTestPage(this); _factoryResetPage = new FactoryResetPage(this); _findMyGearPage = new FindMyGearPage(this); _touchpadPage = new TouchpadPage(this); _customActionPage = new CustomActionPage(this); _ambientSoundPage = new AmbientSoundPage(this); _equalizerPage = new EqualizerPage(this); _connectionLostPage = new ConnectionLostPage(this); _deviceSelectPage = new DeviceSelectPage(this); _settingPage = new SettingPage(this); _updatePage = new UpdatePage(this); _advancedPage = new AdvancedPage(this); _unsupportedFeaturePage = new UnsupportedFeaturePage(this); _popupSettingPage = new PopupSettingPage(this); InitializeComponent(); _tbi = new TaskbarIcon(); Stream iconStream = Application.GetResourceStream(new Uri("pack://*****:*****@"CRITICAL: Unknown Win32 Bluetooth service error"); Console.WriteLine(e); } }
private void DarkMode_OnSwitchToggled(object sender, bool e) { Properties.Settings.Default.DarkMode2 = (DarkMode)Convert.ToInt32(e); Properties.Settings.Default.Save(); DarkModeHelper.Update(); }
private void DarkMode_OnMouseLeftButtonUp(object sender, MouseButtonEventArgs e) { DarkModeToggle.Toggle(); DarkModeHelper.SetState(DarkModeToggle.IsChecked); SaveChanges(); }