mirror of
https://github.com/microsoft/PowerToys.git
synced 2026-04-08 20:27:36 +02:00
CmdPal: Fix opening SUI pages in other languages (#38153)
What we were doing only worked in English. The `.ToString` would get you the text of the nav item, not the `Tag` `InvokedItemContainer` gets you the `NavigationViewItem`.
This commit is contained in:
@@ -42,12 +42,8 @@ public sealed partial class SettingsWindow : Window,
|
|||||||
|
|
||||||
private void NavView_ItemInvoked(NavigationView sender, NavigationViewItemInvokedEventArgs args)
|
private void NavView_ItemInvoked(NavigationView sender, NavigationViewItemInvokedEventArgs args)
|
||||||
{
|
{
|
||||||
var selectedItem = args.InvokedItem;
|
var selectedItem = args.InvokedItemContainer;
|
||||||
|
Navigate((selectedItem.Tag as string)!);
|
||||||
if (selectedItem is not null)
|
|
||||||
{
|
|
||||||
Navigate(selectedItem.ToString()!);
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
private void Navigate(string page)
|
private void Navigate(string page)
|
||||||
|
|||||||
Reference in New Issue
Block a user