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

Updating navigation tree for settings with groupings #35559

Merged
merged 16 commits into from
Oct 27, 2024
Merged
Show file tree
Hide file tree
Changes from 8 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
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
264 changes: 144 additions & 120 deletions src/settings-ui/Settings.UI/SettingsXAML/Views/ShellPage.xaml

Large diffs are not rendered by default.

Original file line number Diff line number Diff line change
Expand Up @@ -277,7 +277,7 @@ private void OobeButton_Click(object sender, RoutedEventArgs e)

private bool navigationViewInitialStateProcessed; // avoid announcing initial state of the navigation pane.

private void NavigationView_PaneOpened(Microsoft.UI.Xaml.Controls.NavigationView sender, object args)
private void NavigationView_PaneOpened(NavigationView sender, object args)
{
if (!navigationViewInitialStateProcessed)
{
Expand All @@ -293,7 +293,7 @@ private void NavigationView_PaneOpened(Microsoft.UI.Xaml.Controls.NavigationView

if (AutomationPeer.ListenerExists(AutomationEvents.MenuOpened))
{
var loader = Helpers.ResourceLoaderInstance.ResourceLoader;
var loader = ResourceLoaderInstance.ResourceLoader;
peer.RaiseNotificationEvent(
AutomationNotificationKind.ActionCompleted,
AutomationNotificationProcessing.ImportantMostRecent,
Expand All @@ -302,7 +302,7 @@ private void NavigationView_PaneOpened(Microsoft.UI.Xaml.Controls.NavigationView
}
}

private void NavigationView_PaneClosed(Microsoft.UI.Xaml.Controls.NavigationView sender, object args)
private void NavigationView_PaneClosed(NavigationView sender, object args)
{
if (!navigationViewInitialStateProcessed)
{
Expand All @@ -318,7 +318,7 @@ private void NavigationView_PaneClosed(Microsoft.UI.Xaml.Controls.NavigationView

if (AutomationPeer.ListenerExists(AutomationEvents.MenuClosed))
{
var loader = Helpers.ResourceLoaderInstance.ResourceLoader;
var loader = ResourceLoaderInstance.ResourceLoader;
peer.RaiseNotificationEvent(
AutomationNotificationKind.ActionCompleted,
AutomationNotificationProcessing.ImportantMostRecent,
Expand Down
22 changes: 17 additions & 5 deletions src/settings-ui/Settings.UI/Strings/en-us/Resources.resw
Original file line number Diff line number Diff line change
Expand Up @@ -59,10 +59,7 @@
: using a System.ComponentModel.TypeConverter
: and then encoded with base64 encoding.
-->
<xsd:schema id="root"
xmlns=""
xmlns:xsd="http://www.w3.org/2001/XMLSchema"
xmlns:msdata="urn:schemas-microsoft-com:xml-msdata">
<xsd:schema id="root" xmlns="" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:msdata="urn:schemas-microsoft-com:xml-msdata">
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

this was VS automatically adjusting this, fyi

<xsd:import namespace="http://www.w3.org/XML/1998/namespace" />
<xsd:element name="root" msdata:IsDataSet="true">
<xsd:complexType>
Expand Down Expand Up @@ -4563,4 +4560,19 @@ Activate by holding the key for the character you want to add an accent to, then
<data name="GeneralPage_ViewDiagnosticDataViewerInfoButton.Content" xml:space="preserve">
<value>Restart</value>
</data>
</root>
<data name="Shell_TopLevelAdvanced.Content" xml:space="preserve">
<value>Advanced</value>
</data>
<data name="Shell_TopLevelFileManagement.Content" xml:space="preserve">
<value>File Management</value>
</data>
<data name="Shell_TopLevelInputOutput.Content" xml:space="preserve">
<value>Input / Output</value>
</data>
<data name="Shell_TopLevelWindowsAndLayouts.Content" xml:space="preserve">
<value>Windowing &amp; Layouts</value>
</data>
<data name="Shell_TopLevelSystemTools.Content" xml:space="preserve">
<value>System Tools</value>
</data>
</root>
6 changes: 5 additions & 1 deletion src/settings-ui/Settings.UI/ViewModels/ShellViewModel.cs
Original file line number Diff line number Diff line change
Expand Up @@ -111,7 +111,11 @@ private void OnItemInvoked(NavigationViewItemInvokedEventArgs args)
.OfType<NavigationViewItem>()
.First(menuItem => (string)menuItem.Content == (string)args.InvokedItem);
var pageType = item.GetValue(NavHelper.NavigateToProperty) as Type;
NavigationService.Navigate(pageType);

if (pageType != null)
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

without the L1 having a nav target, it would crash

{
NavigationService.Navigate(pageType);
}
}

private void OnBackRequested(NavigationView sender, NavigationViewBackRequestedEventArgs args)
Expand Down
Loading