private async void LoadDeliveryBatches() { DeliveryBatches = new ObservableCollection <DeliveryBatchVM>(); var deliveryResult = await RestHub.DeleveryBatches(); if (deliveryResult.HttpCode == System.Net.HttpStatusCode.OK) { List <DeliveryBatchDTO> deliveryBatches = (List <DeliveryBatchDTO>)deliveryResult.UserObject; foreach (var batchDto in deliveryBatches) { DeliveryBatches.Add(new DeliveryBatchVM { Id = batchDto.Id, BatchNumber = batchDto.BatchNumber }); } DeliveryBatch = DeliveryBatches.FirstOrDefault(); } else { AppErrorBox.ShowErrorMessage("Can't Load Delivery Batches . .", deliveryResult.StatusMessage); } }