private async void DoSearch(object obj) { Loading = true; UserEntries = new ObservableCollection <QueryReportEntryVM>(); if (From != null && To != null) { var result = await RestHub.QueryReport(new QueryReportRequestDTO { From = From, To = To }); if (result.UserObject != null) { var dtos = result.UserObject as List <QueryReportEntryDTO>; if (dtos != null) { foreach (var dto in dtos) { UserEntries.Add(new QueryReportEntryVM { User = dto.User, Created = dto.Created, Responded = dto.Responded }); } } } else { AppErrorBox.ShowErrorMessage("Error While Loading Report . .", result.StatusMessage); } } else { MessageBox.Show("Please select dates . ."); } Loading = false; }