// ********************************************* // #region "constructor" public MainViewModel(IMainWindow view, IOtherSettingsView viewOtherSettings) { _view = view; _measRepository = new MeasRepository("data/measurements.csv"); _configRepository = new ConfigRepository("data/OmsLite.exe.config"); _vmOtherSettings = new OtherSettingsViewModel(_configRepository, viewOtherSettings); _vmChosenMeasurement = new ChosenMeasurementViewModel(_configRepository, _measRepository); _vmAllMeasurements = new AllMeasurementsViewModel(_measRepository, _vmChosenMeasurement); // ----------------- commands SaveCmd = new RelayCommand(Save, () => _dirty); // ----------------- messages Messenger.Default.Register <bool>(this, _ => { _dirty = true; }); }
public MainViewModel(IMainWindow view, IOtherSettingsView viewOtherSettings) { _view = view; _measRepository = new MeasRepository("data/measurements.csv"); _configRepository = new ConfigRepository("data/OmsLite.exe.config"); _vmOtherSettings = new OtherSettingsViewModel(_configRepository, viewOtherSettings); _vmChosenMeasurement = new ChosenMeasurementViewModel(_configRepository, _measRepository); _vmAllMeasurements = new AllMeasurementsViewModel(_measRepository, _vmChosenMeasurement); // ----------------- commands SaveCmd = new RelayCommand(Save, () => _dirty); // ----------------- messages Messenger.Default.Register<bool>(this, _ => { _dirty = true; }); }