public ViewConfigurationWindow(List <Entity> stateObjects, ViewConfiguration viewConfiguration) { _stateObjects = stateObjects; InitializeComponent(); ViewConfiguration = viewConfiguration; GenerateTree(); SizeChanged += (o, args) => { MaximizeMinimizeIcon.Kind = WindowState == WindowState.Maximized ? PackIconKind.WindowMaximize : PackIconKind.WindowRestore; }; ChangeThemeButton.Content = $"Theme: {viewConfiguration.GetProperty(ViewConfiguration.ThemeKey)}"; MirrorNotificationsButton.Content = $"Mirror notifications: {viewConfiguration.GetProperty(ViewConfiguration.MirrorNotificationsKey)}"; }
private void OnStartup(object sender, StartupEventArgs e) { Storage.InitConfigDirectory(); Configuration configuration = Storage.RestoreConfiguration(); ViewConfiguration viewConfiguration = Storage.RestoreViewConfiguration(); var paletteHelper = new PaletteHelper(); var theme = paletteHelper.GetTheme(); theme.SetBaseTheme(viewConfiguration.GetProperty(ViewConfiguration.ThemeKey) == ViewConfiguration.LightTheme ? new MaterialDesignLightTheme() : (IBaseTheme) new MaterialDesignDarkTheme()); paletteHelper.SetTheme(theme); if (configuration == null) { ConsoleWriter.WriteLine("NO CONFIGURATION", ConsoleColor.Red); new AuthWindow().Show(); } else { ConsoleWriter.WriteLine($"configuration.Url = {configuration.Url}", ConsoleColor.Green); new MainWindow(configuration, viewConfiguration).Show(); } }
private static void StartUi(ViewConfiguration viewConfiguration, Configuration configuration) { var paletteHelper = new PaletteHelper(); var theme = paletteHelper.GetTheme(); theme.SetBaseTheme(viewConfiguration.GetProperty(ViewConfiguration.ThemeKey) == ViewConfiguration.LightTheme ? new MaterialDesignLightTheme() : (IBaseTheme) new MaterialDesignDarkTheme()); paletteHelper.SetTheme(theme); if (configuration == null) { ConsoleWriter.WriteLine("NO CONFIGURATION", ConsoleColor.Red); new AuthWindow().Show(); } else { ConsoleWriter.WriteLine($"configuration.Url = {configuration.Url}", ConsoleColor.Green); new MainWindow(configuration, viewConfiguration).Show(); } }