public MainWindowViewModel(
            IApplicationShutdownService applicationShutdownService,
            IDispatcherWrapper dispatcherWrapper,
            ICityViewModelFactory cityViewModelFactory,
            IBackendClient backendClient,
            ITemperatureViewModelFactory temperatureViewModelFactory,
            IWindSpeedViewModelFactory windSpeedViewModelFactory,
            IWeatherViewModelFactory weatherViewModelFactory)
        {
            _cityViewModelFactory    = cityViewModelFactory;
            _backendClient           = backendClient;
            _weatherViewModelFactory = weatherViewModelFactory;

            ShutdownApplicationCommand = new RelayCommand(applicationShutdownService.Shutdown);

            SelectedTemperature = temperatureViewModelFactory.Create(TemperatureUnit.Celsius);

            _temperatureViewModels.Add(SelectedTemperature);
            _temperatureViewModels.Add(temperatureViewModelFactory.Create(TemperatureUnit.Fahrenheit));

            SelectedWindSpeed = windSpeedViewModelFactory.Create(WindSpeedUnit.MetersPerSecond);

            _windSpeedViewModels.Add(SelectedWindSpeed);
            _windSpeedViewModels.Add(windSpeedViewModelFactory.Create(WindSpeedUnit.KilometersPerHour));
            _windSpeedViewModels.Add(windSpeedViewModelFactory.Create(WindSpeedUnit.MilesPerHour));

            dispatcherWrapper.BeginInvokeLowPriority(Initialize);
        }
        public UnsavedChangesViewModel(IApplicationShutdownService applicationShutdownService, IWindowService windowService)
        {
            _applicationShutdownService = applicationShutdownService;
            _windowService = windowService;
            var windows = _applicationShutdownService.GetBlockingWindows();

            WindowTitles = new ObservableCollection <string>(windows);
        }
Beispiel #3
0
 public StartUpViewModel(IWindowService windowService, IApplicationShutdownService applicationShutdownService)
 {
     _windowService = windowService;
     _applicationShutdownService = applicationShutdownService;
 }
 public ExceptionViewModel(IApplicationShutdownService applicationShutdownService, IWindowService windowService)
 {
     _applicationShutdownService = applicationShutdownService;
     _windowService = windowService;
 }