private void DetailsButtonOnClick(object sender, RoutedEventArgs e) { MsgLabel.Visibility = Visibility.Collapsed; CustomListViewColumn column = (CustomListViewColumn)sender; int idx = CustomListView.ItemList.Children.IndexOf(column); Game game = DataLists.GetGames()[idx]; GameDetailsExpender.IsExpanded = true; GameDetails.ShowDetails(game); }
private void UpdateList() { MsgLabel.Visibility = Visibility.Visible; (string msg, bool err) = DataLists.UpdateGameList(); MsgLabel.ShowMessage(msg, err); CustomListView.ItemList.Children.Clear(); foreach (var game in DataLists.GetGames()) { CustomListViewColumn column = new CustomListViewColumn { Data1 = { Content = game.TeamNumber }, Data2 = { Content = game.GameNumber } }; column.MouseDoubleClick += DetailsButtonOnClick; CustomListView.ItemList.Children.Add(column); } }