public void Setup() { _updater = new Mock <IAutoUpdater>(); _settings = new AutoUpdateSettings(); _dispatcher = new ManualDispatcher(); _viewModel = new AutoUpdateViewModel(_updater.Object, _settings, _dispatcher); }
public MainWindowViewModel(ApplicationSettings settings, DataSources dataSources, QuickFilters quickFilters, IActionCenter actionCenter, IAutoUpdater updater, IDispatcher dispatcher) { if (dataSources == null) throw new ArgumentNullException("dataSources"); if (quickFilters == null) throw new ArgumentNullException("quickFilters"); if (updater == null) throw new ArgumentNullException("updater"); if (dispatcher == null) throw new ArgumentNullException("dispatcher"); _dataSourcesViewModel = new DataSourcesViewModel(settings, dataSources); _dataSourcesViewModel.PropertyChanged += DataSourcesViewModelOnPropertyChanged; _quickFilters = new QuickFiltersViewModel(settings, quickFilters); _quickFilters.OnFiltersChanged += OnQuickFiltersChanged; _settings = new SettingsViewModel(settings); _actionCenter = new ActionCenterViewModel(dispatcher, actionCenter); _timer = new DispatcherTimer { Interval = TimeSpan.FromMilliseconds(100) }; _timer.Tick += TimerOnTick; _timer.Start(); _autoUpdater = new AutoUpdateViewModel(updater, settings.AutoUpdate, dispatcher); _dispatcher = dispatcher; WindowTitle = Constants.MainWindowTitle; _selectNextDataSourceCommand = new DelegateCommand(SelectNextDataSource); _selectPreviousDataSourceCommand = new DelegateCommand(SelectPreviousDataSource); _addDataSourceCommand = new DelegateCommand(AddDataSource); ChangeDataSource(CurrentDataSource); }
public RootViewModel(IInstallationService installationService, AttendedViewModel attendedViewModel, AutoUpdateViewModel autoUpdateViewModel) { _installationService = installationService; _attendedViewModel = attendedViewModel; _autoUpdateViewModel = autoUpdateViewModel; }