// Application OnStartup Override. protected override async void OnStartup(StartupEventArgs e) { Interactions.ShowFirstTimeSetup.RegisterHandler(interaction => { var dialog = new DialogHostView(); dialog.ViewModel.HostedViewModel = Locator.Current.GetService <FirstSetupWizardViewModel>(); return(Observable.Start(() => { var result = dialog.ShowDialog() == true; interaction.SetOutput(result); }, RxApp.MainThreadScheduler)); }); var settings = Locator.Current.GetService <ISettingsManager>(); var loggerService = Locator.Current.GetService <ILoggerService>(); // Startup speed boosting (HC) ApplicationHelper.StartProfileOptimization(); loggerService.Log("Starting application"); await Initializations.InitializeWebview2(loggerService); loggerService.Log("Initializing red database"); Initializations.InitializeThemeHelper(); // main app viewmodel loggerService.Log("Initializing Shell"); Initializations.InitializeShell(settings); loggerService.Log("Initializing Discord RPC API"); DiscordHelper.InitializeDiscordRPC(); loggerService.Log("Initializing Github API"); Initializations.InitializeGitHub(); // Some things can only be initialized after base.OnStartup(e); base.OnStartup(e); //loggerService.Info("Initializing NodeNetwork."); //NNViewRegistrar.RegisterSplat(); }
protected override async void OnStartup(StartupEventArgs e) { var serviceLocator = ServiceLocator.Default; serviceLocator.RegisterType <IRibbonService, RibbonService>(); #if DEBUG LogManager.AddDebugListener(false); #endif Log.Info("Starting application"); Log.Info("Initializing MVVM"); await AppHelper.InitializeMVVM(); Log.Info("Initializing Theme Helper"); Initializations.InitializeThemeHelper(); Log.Info("Initializing Shell"); await AppHelper.InitializeShell(); AppHelper.ShowFirstTimeSetup(); Log.Info("Initializing Discord RPC"); DiscordHelper.InitializeDiscordRPC(); Log.Info("Initializing Github"); Initializations.InitializeGitHub(); Log.Info("Calling base.OnStartup"); base.OnStartup(e); Log.Info("Initializing NodeNetwork"); NNViewRegistrar.RegisterSplat(); NotificationHelper.InitializeNotificationHelper(); // Temp Fix for MainViewModel.OnClosing if (MainWindow != null) { MainWindow.Closing += OnClosing; } }
// Application OnStartup Override. protected override void OnStartup(StartupEventArgs e) { // check prerequisites // check Webview2 string keyName = @"SOFTWARE\Wow6432Node\Microsoft\EdgeUpdate\ClientState\{F3017226-FE2A-4295-8BDF-00C3A9A7E4C5}"; string keyvalue = "pv"; StaticReferences.IsWebView2Enabled = Models.Commonfunctions.RegistryValueExists(Microsoft.Win32.RegistryHive.LocalMachine, keyName, keyvalue); // Startup speed boosting (HC) ApplicationHelper.StartProfileOptimization(); #if DEBUG LogManager.AddDebugListener(false); #endif StaticReferences.Logger.Info("Starting application"); Initializations.InitializeWebview2(); StaticReferences.Logger.Info("Initializing MVVM"); Initializations.InitializeMVVM(); StaticReferences.Logger.Info("Initializing Theme Helper"); Initializations.InitializeThemeHelper(); InitializeCommands(); StaticReferences.Logger.Info("Initializing Shell"); /*await*/ Initializations.InitializeShell(); var growl = ServiceLocator.Default.ResolveType <INotificationService>(); var settings = ServiceLocator.Default.ResolveType <ISettingsManager>(); Helpers.ShowFirstTimeSetup(settings, growl); StaticReferences.Logger.Info("Initializing Discord RPC API"); DiscordHelper.InitializeDiscordRPC(); StaticReferences.Logger.Info("Initializing Github API"); Initializations.InitializeGitHub(); StaticReferences.Logger.Info("Calling base.OnStartup"); base.OnStartup(e); // Some things can only be initialized after base.OnStartup(e); StaticReferences.Logger.Info("Initializing NodeNetwork."); NNViewRegistrar.RegisterSplat(); StaticReferences.Logger.Info("Initializing Notifications."); StaticReferences.Logger.Info("Check for new updates"); //Helpers.CheckForUpdates(); Initializations.InitializeBk(); //Window window = new Window(); //window.AllowsTransparency = true; //window.Background = new SolidColorBrush(Colors.Transparent); //window.Content = new HomePageView(); //window.WindowStyle = WindowStyle.None; //window.Show(); // Create WebView Data Folder. //Directory.CreateDirectory(@"C:\WebViewData"); // Message system for video tool. }