예제 #1
0
        private void App_OnStartup(object sender, StartupEventArgs e)
        {
            RenderOptions.ProcessRenderMode         = RenderMode.SoftwareOnly;
            ApplicationStateManager.App             = this;
            ApplicationStateManager.ApplicationExit = () =>
            {
                this.Dispatcher.Invoke(() =>
                {
                    this.Shutdown();
                });
            };
            var pathSet = false;
            var path    = Path.GetDirectoryName(Assembly.GetExecutingAssembly().Location);

            if (path != null)
            {
                var oneUpPath = new Uri(Path.Combine(path, @"..\")).LocalPath;
                Paths.SetRoot(oneUpPath);
                Paths.SetAppRoot(path);
                Environment.CurrentDirectory = oneUpPath;
                pathSet = true;
            }
            ServicePointManager.Expect100Continue = true;
            ServicePointManager.SecurityProtocol  = SecurityProtocolType.Tls |
                                                    SecurityProtocolType.Tls11 |
                                                    SecurityProtocolType.Tls12 |
                                                    SecurityProtocolType.Ssl3;
            ConfigManager.InitializeConfig();
            ThemeSetterManager.SetTheme("Light");

            var canRun = ApplicationStateManager.SystemRequirementsEnsured();

            if (!canRun)
            {
                Shutdown();
                return;
            }

            var main = new MainWindow();

            main.Show();
        }
예제 #2
0
 private async void MainWindow_OnLoaded(object sender, RoutedEventArgs e)
 {
     ThemeSetterManager.SetThemeSelectedThemes();
     await MainWindow_OnLoadedTask();
 }