protected override void New() { SupplierProductDTO newSupplierCondition = new SupplierProductDTO(); ConditionDetailViewModel detailModelView = new ConditionDetailViewModel(newSupplierCondition, true); if (NavigationService.NavigateTo("Detail", detailModelView) == NavigationResult.Ok) { ParentObject.MarkChildForInsertion(newSupplierCondition); Items.Add(newSupplierCondition); SelectedItem = newSupplierCondition; } }
protected override void Edit() { SupplierProductDTO editCondition = SelectedItem.Clone(); ConditionDetailViewModel detailModelView = new ConditionDetailViewModel(editCondition, false); if (NavigationService.NavigateTo("Detail", detailModelView) == NavigationResult.Ok) { int index = Items.IndexOf(SelectedItem); Items.Remove(SelectedItem); Items.Insert(index, editCondition); SelectedItem = editCondition; ParentObject.MarkChildForUpdate(editCondition); } }