Example #1
0
        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);
            }
        }
Example #2
0
        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);
            }
        }