/// <summary> /// Constructor of the class. Sets up the commands and initiates <see cref="MeasurementInfo"/>. /// </summary> /// <param name="MeasurementID"></param> public MeasurementInfoViewModel(int MeasurementID) { SaveCommand = new RelayCommand(() => _SaveCommand(), () => true); CancelCommand = new RelayCommand(() => _CancelCommand(), () => true); Database = MyGlobals.Database; MeasurementInfo = new MeasurementInfoClass(Database); MeasurementInfo.Measurement = Database.Measurements.FirstOrDefault(x => x.MeasurementID == MeasurementID); }
/// <summary> /// Constructor of the class. Sets up the commands an initializes the variables. /// </summary> /// <param name="FileName">The name of the file containing the <see cref="Measurement"/>s to import.</param> public MeasurementImportViewModel(string FileName) { AddCurrentMeasurementCommand = new RelayCommand(() => _AddCurrentMeasurementCommand(), () => true); AddAllMeasurementsCommand = new RelayCommand(() => _AddAllMeasurementsCommand(), () => true); CancelCommand = new RelayCommand(() => _CancelCommand(), () => true); newMeausurements = new ObservableCollection<Measurement>(); UpdatePlot = new ObservableCollection<int>(); Database = MyGlobals.Database; //Database.Log = Console.Out; MeasurementInfo = new MeasurementInfoClass(Database); LoadMeasurements(FileName); }