private void CboFavoriteTeam_SelectionChanged(object sender, SelectionChangedEventArgs e) { SelectedFavoriteTeam = cboFavoriteTeam.SelectedItem as TeamFifaData; Configuration.FavoriteTeamCode = (cboFavoriteTeam.SelectedItem as TeamFifaData).FifaCode; LoadOppositiontoFavorite(); SoccerCanvas.Children.Clear(); }
private async void CboFavoriteTeam_Loaded(object sender, RoutedEventArgs e) { try { var Teams = await repo.FetchTeamsAsync(); cboFavoriteTeam.ItemsSource = Teams; if (Configuration.FavoriteTeamCode != String.Empty && Configuration.FavoriteTeamCode != null && Configuration.FavoriteTeamCode != "") { SelectedFavoriteTeam = Teams.Where(x => x.FifaCode == Configuration.FavoriteTeamCode).First(); cboFavoriteTeam.SelectedItem = SelectedFavoriteTeam; LoadOppositiontoFavorite(); } else { cboFavoriteTeam.SelectedIndex = 0; } } catch (Exception ex) { MessageBox.Show(ex.Message); } }
public MatchupDetails(TeamFifaData favorite, TeamFifaData opposition) { Favorite = favorite; Opposition = opposition; InitializeComponent(); }