Exemple #1
0
        public ShellViewModel(
            ISettingsService settingsService,
            IScreenManager screenManager,
            ITimerFactory timerFactory,
            IWindowManager windowManager,
            IMessageProvider messageProvider)
        {
            this.settingsService = settingsService;
            this.messageProvider = messageProvider;

            Keys    = new ObservableCollection <Message>();
            Screens = new ObservableCollection <DetailedScreen>(screenManager.GetScreens());

            Settings = settingsService.Get <Settings>("PopupSettings");
            if (Settings == null)
            {
                Settings = new Settings();
                SetDefaultSettings();
            }

            PlaceScreen();

            windowManager.ShowWindow(new KeyShowViewModel(Keys, Settings));

            timerToken = timerFactory.Start(1000, Cleanup);
        }
Exemple #2
0
        public ShellViewModel(
            ISettingsProvider settingsProvider,
            IScreenManager screenManager,
            ITimerFactory timerFactory,
            IWindowManager windowManager,
            IMessageProvider messageProvider)
        {
            this.settingsProvider = settingsProvider;
            this.messageProvider  = messageProvider;

            Keys    = new ObservableCollection <Message>();
            Screens = new ObservableCollection <DetailedScreen>(screenManager.GetScreens());

            Settings = settingsProvider.GetSettings <PopupSettings>();

            PlaceScreen();

            keyShowViewModel = new KeyShowViewModel(Keys, Settings);
            windowManager.ShowWindow(keyShowViewModel);

            timerToken = timerFactory.Start(1000, Cleanup);
        }