コード例 #1
0
        public MainWindow(AppSettings settings)
        {
            InitializeComponent();
            Instance = this;

            UpdateNotesViewComponent(settings);

            _scManager = new GlobalShortcutManager(this);

            StartupConfigWindow(settings);

            SetupScintilla(settings);

            _viewmodel = new MainWindowViewmodel(settings, this);
            _viewmodel.ManuallyTriggerSelectedNoteChanged();

            DataContext = _viewmodel;

            FocusScintillaDelayed(250);

            if (App.IsUpdateMigration)
            {
                OnAfterMigrate(App.UpdateMigrationFrom, App.UpdateMigrationTo);
            }
        }
コード例 #2
0
ファイル: MainWindow.xaml.cs プロジェクト: httpmad/AlephNote
        public MainWindow(AppSettings settings)
        {
            InitializeComponent();
            Instance = this;

            UpdateNotesViewComponent(settings);

            _scManager = new GlobalShortcutManager(this);

            StartupConfigWindow(settings);

            SetupScintilla(settings);

            viewmodel   = new MainWindowViewmodel(settings, this);
            DataContext = viewmodel;

            FocusScintillaDelayed(250);
        }
コード例 #3
0
        public SettingsWindow(MainWindowViewmodel owner, AppSettings data)
        {
            if (string.IsNullOrWhiteSpace(data.ListFontFamily))
            {
                data.ListFontFamily = FontNameToFontFamily.StrDefaultValue;
            }
            if (string.IsNullOrWhiteSpace(data.NoteFontFamily))
            {
                data.NoteFontFamily = FontNameToFontFamily.StrDefaultValue;
            }
            if (string.IsNullOrWhiteSpace(data.TitleFontFamily))
            {
                data.TitleFontFamily = FontNameToFontFamily.StrDefaultValue;
            }

            InitializeComponent();

            ownerVM     = owner;
            viewmodel   = new SettingsWindowViewmodel(owner.Owner, data.Clone());
            DataContext = viewmodel;
        }
コード例 #4
0
        public static void Show(MainWindow owner, MainWindowViewmodel vm, Version onlineVersion, DateTime onlinePublishDate, string onlineDownloadUrl)
        {
            var dlg = new UpdateWindow {
                MainWindow = owner, MainViewmodel = vm
            };

            if (owner != null && owner.IsLoaded)
            {
                dlg.Owner = owner;
            }
            else
            {
                dlg.WindowStartupLocation = WindowStartupLocation.CenterScreen;
            }

            dlg.viewmodel.DateOnline    = onlinePublishDate;
            dlg.viewmodel.VersionOnline = onlineVersion.ToString(3);

            dlg.viewmodel.URL = onlineDownloadUrl;

            dlg.ShowDialog();
        }
コード例 #5
0
        public SettingsWindow(MainWindowViewmodel owner, AppSettings data)
        {
            if (string.IsNullOrWhiteSpace(data.ListFontFamily))
            {
                data.ListFontFamily = FontNameToFontFamily.StrDefaultValue;
            }
            if (string.IsNullOrWhiteSpace(data.NoteFontFamily))
            {
                data.NoteFontFamily = FontNameToFontFamily.StrDefaultValue;
            }
            if (string.IsNullOrWhiteSpace(data.TitleFontFamily))
            {
                data.TitleFontFamily = FontNameToFontFamily.StrDefaultValue;
            }

            InitializeComponent();

            // HACK: Set this binding in code - otherwise you can't see the underlying panel in the XAML designer
            AdvancedWarningGrid.SetBinding(UIElement.VisibilityProperty, nameof(SettingsWindowViewmodel.HideAdvancedVisibility));

            _ownerVM    = owner;
            _viewmodel  = new SettingsWindowViewmodel(owner.Owner, data.Clone());
            DataContext = _viewmodel;
        }