Example #1
0
        public ShellViewModel(IKernel kernel, MainManager mainManager, MetroDialogService metroDialogService,
                              FlyoutSettingsViewModel flyoutSettings)
        {
            _kernel = kernel;

            MainManager        = mainManager;
            MetroDialogService = metroDialogService;

            DisplayName     = "Artemis";
            GeneralSettings = SettingsProvider.Load <GeneralSettings>();
            Flyouts         = new BindableCollection <FlyoutBaseViewModel>
            {
                flyoutSettings
            };

            MainManager.EnabledChanged += (sender, args) => Enabled = args.Enabled;

            // This gets updated automatically but during startup lets quickly preset it
            Enabled = GeneralSettings.Suspended;
        }
Example #2
0
        public ShellViewModel(IKernel kernel, MainManager mainManager, MetroDialogService metroDialogService, FlyoutSettingsViewModel flyoutSettings)
        {
            _kernel = kernel;
            var checkedForUpdate = false;

            MainManager        = mainManager;
            MetroDialogService = metroDialogService;

            DisplayName     = "Artemis";
            ActiveIcon      = "../Resources/logo-disabled.ico";
            GeneralSettings = SettingsProvider.Load <GeneralSettings>();
            Flyouts         = new BindableCollection <FlyoutBaseViewModel>
            {
                flyoutSettings
            };

            MainManager.EnabledChanged += (sender, args) =>
            {
                Enabled = args.Enabled;
                // Check for updates once if auto update is enabled and the window is shown
                if (GeneralSettings.AutoUpdate && !checkedForUpdate && CanHideWindow)
                {
                    checkedForUpdate = true;
                    Updater.CheckForUpdate(MetroDialogService);
                }
            };


            // This gets updated automatically but during startup lets quickly preset it
            Enabled = GeneralSettings.Suspended;
        }