Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Sort the Sample App Categories and Samples Alphabetically #136

Merged
merged 1 commit into from
Sep 2, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
Loading