コード例 #1
0
        protected override void New()
        {
            OrderDetailDTO           newOrderDetail  = new OrderDetailDTO();
            OrderItemDetailViewModel detailModelView = new OrderItemDetailViewModel(newOrderDetail, true);

            if (NavigationService.NavigateTo("Detail", detailModelView) == NavigationResult.Ok)
            {
                ParentObject.MarkChildForInsertion(newOrderDetail);
                Items.Add(newOrderDetail);
                SelectedItem = newOrderDetail;
            }
        }
コード例 #2
0
        protected override void Edit()
        {
            OrderDetailDTO           editOrderDetail = SelectedItem.Clone();
            OrderItemDetailViewModel detailModelView = new OrderItemDetailViewModel(editOrderDetail, false);

            if (NavigationService.NavigateTo("Detail", detailModelView) == NavigationResult.Ok)
            {
                int index = Items.IndexOf(SelectedItem);
                Items.Remove(SelectedItem);
                Items.Insert(index, editOrderDetail);
                SelectedItem = editOrderDetail;
                ParentObject.MarkChildForUpdate(editOrderDetail);
            }
        }