예제 #1
0
        public async Task <OrderDetailViewModel> GetViewModelForOrderDetail(OrderItemViewModel selectedOrderItemViewModel)
        {
            return(await Task.Run(async() =>
            {
                var selectedOrder = Orders.Find((order => selectedOrderItemViewModel.OrderId == order.Id));
                var orderDetails = await OrderDetailManager?.GetAsync(selectedOrder);

                var orderDetailViewModel = new OrderDetailViewModel
                {
                    SelectedOrderItemViewModel = selectedOrderItemViewModel,
                    SelectedOrder = selectedOrder,
                    SelectedOrderDetails = orderDetails,
                };
                return orderDetailViewModel;
            }));
        }
예제 #2
0
        public async Task<OrderDetailViewModel> GetViewModelForOrderDetail(OrderItemViewModel selectedOrderItemViewModel)
        {

            return await  Task.Run(async () =>
            {
                var selectedOrder = Orders.Find((order => selectedOrderItemViewModel.OrderId == order.Id));
                var orderDetails = await OrderDetailManager?.GetAsync(selectedOrder);

                var orderDetailViewModel = new OrderDetailViewModel
                {
                    SelectedOrderItemViewModel = selectedOrderItemViewModel,
                    SelectedOrder = selectedOrder,
                    SelectedOrderDetails = orderDetails,

                };
                return orderDetailViewModel;

            });
        }
예제 #3
0
 public OrderDetailsPage(OrderDetailViewModel viewModel) : this()
 {
     if (viewModel == null)
         viewModel = new OrderDetailViewModel();
     BindingContext = viewModel;
 }