public NavigationTreeviewModel(Catalog catalog) { var platformItem = new NavigationTreeviewModelItem() { Text = "Platforms", Type = NavigationTreeviewModelItemType.Platforms, FontWeight = FontWeights.Bold, }; this.Items.Add(platformItem); foreach (var gameList in catalog.GameLists) { platformItem.Children.Add(new NavigationTreeviewModelItem() { Text = gameList.PlatformFolderName, Type = NavigationTreeviewModelItemType.Platform, GameList = gameList, }); } this.Items.Add(new NavigationTreeviewModelItem() { Text = "All Incomplete", Type = NavigationTreeviewModelItemType.IncompleteGames, FontWeight = FontWeights.Bold, }); }
private void navigationTreeview_NavigationTreeviewItemSelected(NavigationTreeviewModelItem item) { Mouse.OverrideCursor = Cursors.Wait; gamesListview.Clear(); if (item != null) { if (item.Type == NavigationTreeviewModelItemType.Platform && item.GameList != null) { gamesListview.Load(this.CatalogEditor, (from Game x in item.GameList select x).ToList()); } else if (item.Type == NavigationTreeviewModelItemType.IncompleteGames) { gamesListview.Load(this.CatalogEditor, this.CatalogEditor.GatherIncompleteGames()); } } Mouse.OverrideCursor = null; }