public PaletteView() { InitializeComponent(); DataContext = new PaletteSelectorViewModel(); if (SaveSettings.Default.Theme == "Dark") { ThemeButton.IsChecked = true; } if (SaveSettings.Default.HasBackground == true) { BackgroundButton.IsChecked = true; } if (SaveSettings.Default.WindowsExplorer == true) { Windowstoggled.IsChecked = true; } if (SaveSettings.Default.UnfreezeOnGp == true) { ActorDataGpose.IsChecked = true; } SaveDirectory.Text = SaveSettings.Default.ProfileDirectory; SaveDirectory2.Text = SaveSettings.Default.MatrixPoseDirectory; SaveDirectory3.Text = SaveSettings.Default.GearsetsDirectory; AppTransparencySlider.Maximum = 1000.0; AppTransparencySlider.Minimum = 200.0; AppTransparencySlider.Value = SaveSettings.Default.UITransparency; }
private async void Application_Startup(object sender, StartupEventArgs e) { await _host.StartAsync(); // if the app lost this data for some reason // or the app runs for the first time // it will load the default theme in App.xaml file if (!string.IsNullOrEmpty(WPF.Properties.Settings.Default.PrimaryColor) && !string.IsNullOrEmpty(WPF.Properties.Settings.Default.AccentColor)) { try { IEnumerable <Swatch> Swatches = new SwatchesProvider().Swatches; PaletteSelectorViewModel.ApplyPrimary(Swatches.FirstOrDefault(x => x.Name == WPF.Properties.Settings.Default.PrimaryColor)); PaletteSelectorViewModel.ApplyAccent(Swatches.FirstOrDefault(x => x.Name == WPF.Properties.Settings.Default.AccentColor)); PaletteSelectorViewModel.ApplyBase(WPF.Properties.Settings.Default.IsDarkTheme); } catch (Exception ex) { Console.WriteLine(ex); } } _host.Services .GetRequiredService <IWindowManager>() .ShowWindow <LoginViewModel>(); }
public ConfigPage(AppSetting appSetting, ConfigViewModel dataService, PaletteSelectorViewModel paletteSelector) { InitializeComponent(); DataContext = dataService; panel1.DataContext = paletteSelector; }
public PaletteSelectoPageBuilder() { ViewModel = new PaletteSelectorViewModel(); ViewElement = new PaletteSelector() { DataContext = ViewModel }; }
public PaletteView() { InitializeComponent(); DataContext = new PaletteSelectorViewModel(); if (SaveSettings.Default.Theme == "Dark") { ThemeButton.IsChecked = true; } }
public PanelPaletteSelector() { InitializeComponent(); if (paletteSelectorViewModel == null) { paletteSelectorViewModel = new PaletteSelectorViewModel(Global.Instance.IsDark); } DataContext = paletteSelectorViewModel; }
public PaletteView() { InitializeComponent(); DataContext = new PaletteSelectorViewModel(); if (SaveSettings.Default.Theme == "Dark") ThemeButton.IsChecked = true; if (SaveSettings.Default.HasBackground == true) BackgroundButton.IsChecked = true; if (SaveSettings.Default.WindowsExplorer == true) Windowstoggled.IsChecked = true; SaveDirectory.Text = SaveSettings.Default.ProfileDirectory; SaveDirectory2.Text = SaveSettings.Default.MatrixPoseDirectory; SaveDirectory3.Text = SaveSettings.Default.GearsetsDirectory; }
public MainWindow(MainDataService dataService, PaletteSelectorViewModel paletteSelector, ConfigPage configPage) { InitializeComponent(); DataContext = dataService; panel1.DataContext = paletteSelector; Messenger.Default.Register <String>(this, "打开设置", msg => configPage.ShowDialog()); this.Unloaded += (sender, e) => Messenger.Default.Unregister(this); this.Closing += (sender, e) => { Application.Current.Shutdown();//关闭 Environment.Exit(0); }; }
public PaletteSelector() { InitializeComponent(); DataContext = new PaletteSelectorViewModel(); }