[Settings]Fix using navigation items in scan mode (#22545)

This commit is contained in:
Laszlo Nemeth
2022-12-12 17:34:21 +01:00
committed by GitHub
parent cd1b7dbc2c
commit 6cbb094cfb
2 changed files with 12 additions and 0 deletions

View File

@@ -4,6 +4,7 @@
using System;
using System.Collections.Generic;
using Microsoft.PowerToys.Settings.UI.Helpers;
using Microsoft.PowerToys.Settings.UI.Services;
using Microsoft.PowerToys.Settings.UI.ViewModels;
using Microsoft.UI.Xaml;
@@ -225,5 +226,15 @@ namespace Microsoft.PowerToys.Settings.UI.Views
{
await Launcher.LaunchUriAsync(new Uri("https://aka.ms/powerToysGiveFeedback"));
}
private void NavigationView_SelectionChanged(NavigationView sender, NavigationViewSelectionChangedEventArgs args)
{
NavigationViewItem selectedItem = args.SelectedItem as NavigationViewItem;
if (selectedItem != null)
{
Type pageType = selectedItem.GetValue(NavHelper.NavigateToProperty) as Type;
NavigationService.Navigate(pageType);
}
}
}
}