Esempio n. 1
0
        protected override async void OnViewLoaded(object view)
        {
            ToolPanelsContent.ActivateItem(IoC.Get <IOutput>());

            if (Properties.Settings.Default.ShowNavigationPanelOnOpen)
            {
                ShellLayoutController.Current.LeftContentIsVisible = true;
            }

            if (Properties.Settings.Default.ShowStartPageOnOpen)
            {
                await MainContent.OpenDocument <IStartupDocument>();
            }

            if (Properties.Settings.Default.Diagnostics_ShowManagedMemory)
            {
                StatusBarContent.ActivateContent(new MemoryUsageStatusButton().Start(), StatusBarContentLocation.Right);
            }

            CommandManager.InvalidateRequerySuggested();

            if (!AppConstants.IsDebug)
            {
                _ = Task.Delay(TimeSpan.FromSeconds(30))
                    .ContinueWith(task => { OnUIThread(async() => await AppUpdateManager.Current.CheckForUpdates(false)); })
                    .ConfigureAwait(false);
            }
        }
Esempio n. 2
0
 private async void MainContentOnActiveDocumentChanged(object sender, EventArgs e)
 {
     if (!MainContent.Documents.Any() && Properties.Settings.Default.ShowStartOnCloseAll)
     {
         await MainContent.OpenDocument <IStartupDocument>();
     }
 }
 protected override async void OnViewLoaded(object view)
 {
     if (Properties.Settings.Default.ShowStartPageOnOpen)
     {
         await MainContent.OpenDocument <IStartupDocument>();
     }
 }
Esempio n. 4
0
        public ShellViewModel()
        {
            DisplayName = "LiteDB Explorer";

            WindowMenu = IoC.Get <IShellMenu>();

            WindowRightMenu = IoC.Get <IShellRightMenu>();

            StatusBarContent = IoC.Get <IShellStatusBar>();

            LeftContent = IoC.Get <IDocumentExplorer>();

            MainContent = IoC.Get <IDocumentSet>();

            var initialDocument = MainContent.NewDocumentFactory();

            if (initialDocument != null)
            {
                MainContent.OpenDocument(initialDocument);
            }

            MainContent.ActiveDocumentChanged += (sender, args) =>
            {
                if (!MainContent.Documents.Any() && initialDocument != null)
                {
                    MainContent.OpenDocument(initialDocument);
                }
            };
        }
Esempio n. 5
0
        public ShellViewModel()
        {
            DisplayName = "LiteDB Explorer";

            WindowMenu = IoC.Get <IShellMenu>();

            WindowRightMenu = IoC.Get <IShellRightMenu>();

            StatusBarContent = IoC.Get <IShellStatusBar>();

            LeftContent = IoC.Get <IDocumentExplorer>();

            MainContent = IoC.Get <IDocumentSet>();

            if (Properties.Settings.Default.ShowStartPageOnOpen)
            {
                MainContent.OpenDocument <IStartupDocument>();
            }

            MainContent.ActiveDocumentChanged += (sender, args) =>
            {
                if (!MainContent.Documents.Any() && Properties.Settings.Default.ShowStartOnCloseAll)
                {
                    MainContent.OpenDocument <IStartupDocument>();
                }
            };
        }
Esempio n. 6
0
        protected override async void OnViewLoaded(object view)
        {
            if (Properties.Settings.Default.ShowStartPageOnOpen)
            {
                await MainContent.OpenDocument <IStartupDocument>();
            }

            if (Properties.Settings.Default.Diagnostics_ShowManagedMemory)
            {
                StatusBarContent.ActivateContent(new MemoryUsageStatusButton().Start(), StatusBarContentLocation.Right);
            }

            BottomToolPanels.ActivateItem(IoC.Get <IOutput>());
        }
Esempio n. 7
0
        public ShellViewModel()
        {
            DisplayName = "LiteDB Explorer";

            WindowMenu = IoC.Get <IShellMenu>();

            WindowRightMenu = IoC.Get <IShellRightMenu>();

            StatusBarContent = IoC.Get <IShellStatusBar>();

            LeftContent = IoC.Get <IDocumentExplorer>();

            MainContent = IoC.Get <IDocumentSet>();

            MainContent.OpenDocument(MainContent.NewDocumentFactory());
        }
Esempio n. 8
0
        private async void MainContentOnDocumentDeactivated(object sender, DocumentDeactivateEventArgs e)
        {
            if (!e.Close)
            {
                return;
            }

            if (!MainContent.Documents.Any() && Properties.Settings.Default.ShowStartOnCloseAll)
            {
                if (e.Item is IStartupDocument)
                {
                    return;
                }

                await MainContent.OpenDocument <IStartupDocument>();
            }
        }
Esempio n. 9
0
        protected override async void OnViewLoaded(object view)
        {
            ToolPanelsContent.ActivateItem(IoC.Get <IOutput>());

            if (Properties.Settings.Default.ShowNavigationPanelOnOpen)
            {
                ShellLayoutController.Current.LeftContentIsVisible = true;
            }

            if (Properties.Settings.Default.ShowStartPageOnOpen)
            {
                await MainContent.OpenDocument <IStartupDocument>();
            }

            if (Properties.Settings.Default.Diagnostics_ShowManagedMemory)
            {
                StatusBarContent.ActivateContent(new MemoryUsageStatusButton().Start(), StatusBarContentLocation.Right);
            }

            CommandManager.InvalidateRequerySuggested();
        }