/// <summary> /// /// </summary> private ToppingSingleton() { if (Toppings == null) { Toppings = _fileRepo.ReadFromFile <List <AComponent> >(_path); } }
private async void SetCountrys() { ObservableCollection <string> countrys = new ObservableCollection <string>(); selectedCountry = FileRepo.ReadFromFile(FileRepo.FAV_COUNTRY)[0]; f_code_left = selectedCountry.Substring(selectedCountry.Length - 4, 3); //teams = await DataLayer // .Data // .GetTeams(); teams = await Data.GetCountries("https://worldcup.sfg.io/teams/results"); teams.Sort((x, y) => x.CountryName.CompareTo(y.CountryName)); teams.ForEach(team => countrys.Add($"{team.CountryName.ToUpper()} ({team.FifaCode})")); cbFavRep.ItemsSource = countrys; cbFavRep.SelectedValue = selectedCountry; }