Inheritance: SettingsBase
Beispiel #1
0
        public UpdateService(GeneralSettings settings, MainViewModel mainViewModel)
        {
            _settings = settings;

            Application.Current.Exit += OnApplicationExit;
            _mainViewModel = mainViewModel;
            _timer = new DispatcherTimer();
            _timer.Interval = TimeSpan.FromMinutes(20);
            _timer.Tick += (sender, args) => CheckForUpdates();
            _timer.Start();

            CheckForUpdates();
        }
Beispiel #2
0
        public MainViewModel(IJiraApi jiraApi, GeneralSettings settings, WorkLogUpdater workLogUpdater, IMessenger messenger)
        {
            _jiraApi = jiraApi;
            _messenger = messenger;
            Settings = settings;

            BackCommand = new RelayCommand(Back, () => _navigationHistory.Count > 1);
            ClearMessageCommand = new RelayCommand(() => { UserMessage = ""; });
            OpenSettingsCommand = new RelayCommand(OpenSettings, () => _navigationHistory.Count > 1 && _navigationHistory.Peek().GetType().Name != "ApplicationSettings");
            LogWorkCommand = workLogUpdater.LogWorkCommand;
            BackToPageCommand = new RelayCommand<NavigationHistoryEntry>(BackToPage);
            CloseApplicationCommand = new RelayCommand(CloseApplication);
            OpenRecentUpdatesCommand = new RelayCommand(OpenRecentUpdates);
            ActivateWindowCommand = new RelayCommand(() => WindowVisibility = Visibility.Visible);

            NavigationHistory = new ObservableCollection<NavigationHistoryEntry>();
        }