private void OnChangeStatView(object sender, RoutedEventArgs e) { RadioButton radio = sender as RadioButton; if (radio.Tag != null) { string tag = radio.Tag as String; StatViewType type = (StatViewType)Enum.Parse(typeof(StatViewType), tag); _listView.ItemsSource = _stats.StatsList(type); _listView.SelectedIndex = 0; _listView.Focus(Windows.UI.Xaml.FocusState.Programmatic); } }
public ObservableCollection <Stat> StatsList(StatViewType type) { switch (type) { case StatViewType.Counting: return(_statsAboutCounting); case StatViewType.Crib: return(_statsAboutCrib); case StatViewType.Game: return(_statsAboutGames); case StatViewType.Hand: return(_statsAboutHands); } return(_statsAboutGames); }