Exemple #1
0
        public override void OnFrameworkInitializationCompleted()
        {
            if (ApplicationLifetime is IClassicDesktopStyleApplicationLifetime desktop)
            {
                _desktop = desktop;

                var preferencesService = Locator.Current.GetRequiredService <IPreferencesService>();
                preferencesService.Updated += PreferencesUpdated;

                bool notesDirectorySet = preferencesService.Load();
                Styles.AddRange(ThemeManager.GetThemeStyles(preferencesService.Preferences.Theme));
                Styles.AddRange(ThemeManager.ComponentStyles);

                if (notesDirectorySet)
                {
                    OpenMainWindow(preferencesService.Preferences);
                }
                else
                {
                    var window = new InitialSetupWindow
                    {
                        DataContext = new InitialSetupViewModel(preferencesService),
                        Topmost     = true,
                        CanResize   = false
                    };
                    window.Started += InitialSetup_Started;
                    window.Show();
                    window.Activate();
                }
            }

            base.OnFrameworkInitializationCompleted();
        }
Exemple #2
0
        internal static void ShowInitialSetupWindow()
        {
            if (!LoggedUser.CanAccessInitialSetup)
            {
                MessageWindow.ShowAlertMessage("This module is not available for current user.");
                return;
            }
            var initialSetupWindow = new InitialSetupWindow();

            initialSetupWindow.Show();
        }