public void Select(GamesListviewItem item) { if (this.AllowSelection) { foreach (GamesListviewItem child in stackPanel.Children) { child.IsSelected = false; } item.IsSelected = true; this.SelectedItem = item; this.SelectionChanged?.Invoke(); } }
public void Update() { Clear(); if (this.Games != null) { foreach (Game game in this.Games) { var item = new GamesListviewItem(this, this.CatalogEditor, game, this.AllowSelection, this.AllowEditing); item.Margin = new Thickness(0, 10, 0, 5); stackPanel.Children.Add(item); } } }