private async Task ClearContinents() { capitalOfCountry.DataContext = null; continentList = null; comboboxContinents.ItemsSource = null; continentListFetcher = null; totalContinents.Text = string.Empty; await Task.Delay(10); }
private async Task LoadContinents() { // Instantiate the class continentListFetcher = new ContinentListDataFetcher(); // Select the standard to use continentListFetcher.continentStandard = ContinentModel.ContinentStandard.SixB; // Get the list of continents continentList = await continentListFetcher.fetchContinents(); // Count the number of continents found if (continentList != null) { // Bind the list to the UI comboboxContinents.ItemsSource = continentList; comboboxContinents.SelectedIndex = 0; } // Display the number of continents totalContinents.Text = continentList.Count.ToString(); }