public NewReportFormVM() { FormModel = new NewReportFormModel(); reportModel = FormModel.report.Clone() as Report; AddReportCommand = new RelayCommand <NewReportFormModel>(formModel => { if (reportModel.ReporterName == "" || reportModel.Adress == null) { return; } formModel.report = reportModel.Clone() as Report; Report = new Report(); formModel.AddReportAsync(); }, //if have more condition to add report report => { return(report != null); }); }
public NewReportFormVM() { FormModel = new NewReportFormModel(); reportModel = FormModel.Report.Clone() as Report; AddReportCommand = new RelayCommand <NewReportFormModel>(formModel => { if (reportModel.Name == "" || reportModel.Address == null || reportModel.NoiseIntensity == 0 || reportModel.NumOfExplosions == 0) { return; } formModel.Report = reportModel.Clone() as Report; Report = new Report(); formModel.AddReport(); }, //if have more condition to add report report => { return(report != null); }); }