protected override void Edit() { ProductDTO selectedDto = this.Service.GetProductById(this.SelectedItem.Id); ProductDetailViewModel detailModelView = new ProductDetailViewModel(selectedDto, false); if (NavigationService.NavigateTo("Detail", detailModelView) == NavigationResult.Ok) { this.Load(); this.SelectedItem = this.Items.SingleOrDefault(dto => dto.Id == selectedDto.Id); } }
protected override void New() { ProductDTO newProduct = new ProductDTO(); ProductDetailViewModel detailModelView = new ProductDetailViewModel(newProduct, true); if (NavigationService.NavigateTo("Detail", detailModelView) == NavigationResult.Ok) { this.Load(); this.SelectedItem = this.Items.SingleOrDefault(dto => dto.Id == newProduct.Id); } }