Exemplo n.º 1
0
        // 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();
        }
Exemplo n.º 2
0
        // 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.
        }