Skip to content

Commit

Permalink
Sort the Sample App Categories and Samples Alphabetically
Browse files Browse the repository at this point in the history
  • Loading branch information
michael-hawker committed Sep 2, 2023
1 parent 8013fc7 commit 058718f
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 4 deletions.
8 changes: 5 additions & 3 deletions CommunityToolkit.App.Shared/Helpers/NavigationViewHelper.cs
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ public static class NavigationViewHelper

private static IEnumerable<MUXC.NavigationViewItem> GenerateSampleNavItems(IEnumerable<ToolkitFrontMatter> sampleMetadata)
{
foreach (var metadata in sampleMetadata)
foreach (var metadata in sampleMetadata.OrderBy(meta => meta.Title))
{
yield return new MUXC.NavigationViewItem
{
Expand All @@ -52,7 +52,8 @@ public static class NavigationViewHelper

private static IEnumerable<GroupNavigationItemData> GenerateSubcategoryNavItems(IEnumerable<ToolkitFrontMatter> sampleMetadata)
{
var samplesBySubcategory = sampleMetadata.GroupBy(x => x.Subcategory);
var samplesBySubcategory = sampleMetadata.GroupBy(x => x.Subcategory)
.OrderBy(g => g.Key.ToString());

foreach (var subcategoryGroup in samplesBySubcategory)
{
Expand All @@ -68,7 +69,8 @@ private static IEnumerable<GroupNavigationItemData> GenerateSubcategoryNavItems(

private static IEnumerable<GroupNavigationItemData> GenerateCategoryNavItems(IEnumerable<ToolkitFrontMatter> sampleMetadata)
{
var samplesByCategory = sampleMetadata.GroupBy(x => x.Category);
var samplesByCategory = sampleMetadata.GroupBy(x => x.Category)
.OrderBy(g => g.Key.ToString());

foreach (var categoryGroup in samplesByCategory)
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,7 @@ public enum ToolkitSampleSubcategory : byte
Markup,

/// <summary>
/// Samples that focus on helping with mathmatical operations.
/// Samples that focus on helping with mathematical operations.
/// </summary>
Math,

Expand Down

0 comments on commit 058718f

Please sign in to comment.