async void retrieveCustomSearches() { activityIndicator.IsVisible = true; activityIndicator.IsRunning = true; string httpTask = await Task.Run <string>(() => HttpRequestHandler.PostCustomSearches(userSession.username)); var httpResult = httpTask; activityIndicator.IsVisible = false; activityIndicator.IsRunning = false; pageTitle.IsVisible = true; if (httpResult != null) { if (httpResult != "No custom searches found") { List <customSearchesItem> customerSearches = JsonConvert.DeserializeObject <List <customSearchesItem> >(httpResult); listView.ItemsSource = customerSearches; upBtn.IsVisible = true; } else { errorMsg.IsVisible = true; } } else { Console.WriteLine("search is not null "); errorMsg.IsVisible = true; } }