private void UpdateSelected(TrackObjectBase track) { var item = _countriesInformationList.FirstOrDefault(x => x.DisplayName == track.Country); if (item == null) { return; } CountriesListBox.SelectedItem = item; CountriesListBox.ScrollIntoView(item); }
public void RemoveError(AcErrorType type) { if (!HasError(type)) { return; } _errors.Remove(_errors.FirstOrDefault(x => x.Type == type)); if (Errors.Count == 0) { OnPropertyChanged(nameof(HasErrors)); CommandManager.InvalidateRequerySuggested(); } }
public async void SetSteamId(string steamId) { if (steamId == null) { return; } _cancellationTokenSource?.Cancel(); var existing = SteamProfiles.FirstOrDefault(x => x.SteamId == steamId); if (existing != null) { SteamProfile = existing; return; } var profile = new SteamProfile(steamId); SteamProfiles.Add(profile); SteamProfile = profile; profile.ProfileName = await SteamIdHelper.GetSteamName(steamId); }