private async void LoadFlight() { try { Flight = await FlightRepository.GetFlightDetailsAsync(); string city = Flight.ArrivalDest.Split(" ")[0]; LoadWeather(city); } catch (Exception e) { MessageDialog messageDialog = new MessageDialog($"Couldn't establish a connection to the database. \n{e.Message}"); messageDialog.Commands.Add(new UICommand("Try again", new UICommandInvokedHandler(this.CommandInvokedHandler))); messageDialog.Commands.Add(new UICommand("Close")); messageDialog.DefaultCommandIndex = 0; messageDialog.CancelCommandIndex = 1; await messageDialog.ShowAsync(); } }