Add default case with exception to navigation switch statement - #6252
Merged
Niels Laute (niels9001) merged 2 commits intoFeb 25, 2026
Merged
Conversation
Merged
…tch statement Co-authored-by: niels9001 <9866362+niels9001@users.noreply.github.com>
Copilot
AI
changed the title
[WIP] Apply changes based on feedback for temp update PR
Add default case with exception to navigation switch statement
Feb 25, 2026
Niels Laute (niels9001)
approved these changes
Feb 25, 2026
Niels Laute (niels9001)
marked this pull request as ready for review
February 25, 2026 09:36
Niels Laute (niels9001)
merged commit Feb 25, 2026
7db59da
into
niels9001/template-updates
1 check passed
Niels Laute (niels9001)
added a commit
that referenced
this pull request
Feb 25, 2026
* Adding TitleBar and .ico * Adding the ContentDialog ItemTemplate * Adding NavigationView template * Missed a csharp template and added * Push * Update WinAppSdk.CSharp.DotnetNewTemplates.csproj * Clean up navview project * Update dev/VSIX/ProjectTemplates/Desktop/CSharp/NavigationApp/Pages/HomePage.xaml.cs Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com> * Update dev/VSIX/ProjectTemplates/Desktop/CSharp/NavigationApp/Pages/AboutPage.xaml.cs Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com> * Update dev/VSIX/ProjectTemplates/Desktop/CSharp/NavigationApp/Pages/SettingsPage.xaml.cs Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com> * Update dev/VSIX/ProjectTemplates/Desktop/CSharp/NavigationApp/App.xaml.cs Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com> * Update dev/VSIX/ItemTemplates/Neutral/CSharp/ContentDialog/ContentDialog.xaml.cs Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com> * Update dev/VSIX/ProjectTemplates/Desktop/CSharp/NavigationApp/MainWindow.xaml.cs Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com> * Add default case with exception to navigation switch statement (#6252) * Initial plan * Add default case throwing InvalidOperationException in navigation switch statement Co-authored-by: niels9001 <9866362+niels9001@users.noreply.github.com> --------- Co-authored-by: copilot-swe-agent[bot] <198982749+Copilot@users.noreply.github.com> Co-authored-by: niels9001 <9866362+niels9001@users.noreply.github.com> --------- Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com> Co-authored-by: Copilot <198982749+Copilot@users.noreply.github.com> Co-authored-by: niels9001 <9866362+niels9001@users.noreply.github.com>
Dinah Xiaoman G (DinahK-2SO)
pushed a commit
that referenced
this pull request
Apr 20, 2026
* Adding TitleBar and .ico * Adding the ContentDialog ItemTemplate * Adding NavigationView template * Missed a csharp template and added * Push * Update WinAppSdk.CSharp.DotnetNewTemplates.csproj * Clean up navview project * Update dev/VSIX/ProjectTemplates/Desktop/CSharp/NavigationApp/Pages/HomePage.xaml.cs Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com> * Update dev/VSIX/ProjectTemplates/Desktop/CSharp/NavigationApp/Pages/AboutPage.xaml.cs Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com> * Update dev/VSIX/ProjectTemplates/Desktop/CSharp/NavigationApp/Pages/SettingsPage.xaml.cs Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com> * Update dev/VSIX/ProjectTemplates/Desktop/CSharp/NavigationApp/App.xaml.cs Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com> * Update dev/VSIX/ItemTemplates/Neutral/CSharp/ContentDialog/ContentDialog.xaml.cs Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com> * Update dev/VSIX/ProjectTemplates/Desktop/CSharp/NavigationApp/MainWindow.xaml.cs Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com> * Add default case with exception to navigation switch statement (#6252) * Initial plan * Add default case throwing InvalidOperationException in navigation switch statement Co-authored-by: niels9001 <9866362+niels9001@users.noreply.github.com> --------- Co-authored-by: copilot-swe-agent[bot] <198982749+Copilot@users.noreply.github.com> Co-authored-by: niels9001 <9866362+niels9001@users.noreply.github.com> --------- Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com> Co-authored-by: Copilot <198982749+Copilot@users.noreply.github.com> Co-authored-by: niels9001 <9866362+niels9001@users.noreply.github.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
The
NavView_SelectionChangedhandler in theNavigationAppC# template had no fallback for unrecognizedNavigationViewItemtags, silently swallowing unknown navigation items.Changes
MainWindow.xaml.cs: Addeddefaultcase to theswitch (item.Tag)block that throwsInvalidOperationExceptionwith the unknown tag value, making misconfigurations immediately visible at runtime.A microsoft employee must use /azp run to validate using the pipelines below.
WARNING:
Comments made by azure-pipelines bot maybe inaccurate.
Please see pipeline link to verify that the build is being ran.
For status checks on the main branch, please use TransportPackage-Foundation-PR
(https://microsoft.visualstudio.com/ProjectReunion/_build?definitionId=81063&_a=summary)
and run the build against your PR branch with the default parameters.
🔒 GitHub Advanced Security automatically protects Copilot coding agent pull requests. You can protect all pull requests by enabling Advanced Security for your repositories. Learn more about Advanced Security.