private void ClearClick() { for (int i = (DetailsViewList.Count - 1); i >= 0; i--) { DetailsViewList.RemoveAt(i); } IsEditable = DetailsViewList.Any(); OnPropertyChanged(nameof(DetailsViewList)); }
private void AddClick() { DetailsViewModel view = _uc.Resolve <DetailsViewModel>(new ParameterOverride("bestPosRequired", _bestPosRequired)); var rc = _dlg.ShowDialog <FrmDetailsEdit>(view); if (rc == DialogResult.OK) { DetailsViewList.Add(view); IsEditable = DetailsViewList.Any(); OnPropertyChanged(nameof(DetailsViewList)); } }
private void DeleteClick(object parm) { var rc = _dlg.ShowMessageBox("Wollen Sie diese Detailposition wirklich löschen?", "Detailposition löschen", MessageBoxButtons.YesNo, MessageBoxIcon.Question); if (rc == DialogResult.Yes) { int i = (int)parm; DetailsViewList.RemoveAt(i); IsEditable = DetailsViewList.Any(); OnPropertyChanged(nameof(DetailsViewList)); } }
private bool CanSaveExecute(object obj) { return(DetailsViewList.Any()); }