protected override void OnShow() { base.OnShow(); // Update categories. categoriesDataView.AddRange(inventory.GetCategories()); // Focus on Categories by default and show items from the first category. navigation.Focus(categoriesDataView); categoriesDataView.Select(); categoriesDataView.Highlight(); }
private void CategoriesDataView_Highlighted(CategoryData category) { // Clear all items once a category is selected before repopulating it with the new items. itemsDataView.Clear(); itemsDataView.AddRange(inventory.GetItemsFromCategory(category.CategoryType)); // Move to beginning of list if a different category from the previously selected. if (category.CategoryType != selectedCategory) { itemsDataView.MoveToStart(); } // Highlight first item. itemsDataView.Highlight(); }