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; })); }
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; }); }
public OrderDetailsPage(OrderDetailViewModel viewModel) : this() { if (viewModel == null) viewModel = new OrderDetailViewModel(); BindingContext = viewModel; }