public async void GetData() { Status = "Loading data..."; IsCollectingData = true; if (UseCovidDataSource) { StateData.Clear(); var rawStateData = await ctService.GetHistoricStateData(); var stateBaseInfo = StatesConstants.GetStatesList(); foreach (StateBase sb in stateBaseInfo) { var newState = new State(sb); newState.CovidData = rawStateData.FindAll(sd => sd.State.ToString().ToLower() == newState.StateBase.Code.ToString().ToLower()); StateData.Add(newState); } // Add the vaccine data here // Send in a StateData value and then add the values to the state data day by day if (SortStatesByRegion) { StateData = PerformStateSortByRegion(StateData); } } else if (UseOwidSource) { CountryData.Clear(); CountryData = await owidService.GetAllWorldData(); CountryData = CountryData.OrderBy(c => c.CountryName).ToList(); if (SortCountriesByContinent) { CountryData = PerformCountrySort(CountryData); } if (FilterSmallCountries) { CountryData = PerformSmallCountryFilter(CountryData); } } IsCollectingData = false; isDataLoaded = true; Status = "Data Loaded!"; }