mirror of
https://github.com/microsoft/PowerToys.git
synced 2026-04-05 02:36:19 +02:00
[Settings]Fix using navigation items in scan mode (#22545)
This commit is contained in:
@@ -36,6 +36,7 @@
|
||||
IsTitleBarAutoPaddingEnabled="False"
|
||||
PaneClosed="NavigationView_PaneClosed"
|
||||
PaneOpened="NavigationView_PaneOpened"
|
||||
SelectionChanged="NavigationView_SelectionChanged"
|
||||
SelectedItem="{x:Bind ViewModel.Selected, Mode=OneWay}">
|
||||
<NavigationView.Resources>
|
||||
<SolidColorBrush
|
||||
|
||||
@@ -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);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user