make it happen
Some checks failed
Spell checking / Check Spelling (push) Has been cancelled
Spell checking / Update PR (push) Has been cancelled
Spell checking / Report (Push) (push) Has been cancelled
Spell checking / Report (PR) (push) Has been cancelled

This commit is contained in:
vanzue 2025-05-28 23:30:15 +08:00
parent 2661aa3a6a
commit 4796451bd4
63 changed files with 391 additions and 138 deletions

View File

@ -40,10 +40,16 @@ namespace Microsoft.PowerToys.Settings.UI.XamlIndexBuilder
try
{
var searchableElements = new List<SearchableElementMetadata>();
var xamlFiles = Directory.GetFiles(xamlDirectory, "*Page.xaml", SearchOption.AllDirectories);
var xamlFiles = Directory.GetFiles(xamlDirectory, "*.xaml", SearchOption.AllDirectories);
foreach (var xamlFile in xamlFiles)
{
if (xamlFile.Equals("ShellPage.xaml", StringComparison.OrdinalIgnoreCase))
{
// Skip ShellPage.xaml as it contains many elements not relevant for search
continue;
}
Debug.WriteLine($"Processing: {Path.GetFileName(xamlFile)}");
var elements = ExtractSearchableElements(xamlFile);
searchableElements.AddRange(elements);

View File

@ -1,4 +1,159 @@
[
{
"pageName": "AdvancedPastePage",
"automationId": "AdvancedPaste_Additional_Actions_GroupSettings",
"controlType": "SettingsGroup"
},
{
"pageName": "AdvancedPastePage",
"automationId": "AdvancedPaste_BehaviorSettingsGroup",
"controlType": "SettingsGroup"
},
{
"pageName": "AdvancedPastePage",
"automationId": "AdvancedPaste_Clipboard_History_Enabled_SettingsCard",
"controlType": "SettingsCard"
},
{
"pageName": "AdvancedPastePage",
"automationId": "AdvancedPaste_CloseAfterLosingFocus",
"controlType": "SettingsCard"
},
{
"pageName": "AdvancedPastePage",
"automationId": "AdvancedPaste_Direct_Access_Hotkeys_GroupSettings",
"controlType": "SettingsGroup"
},
{
"pageName": "AdvancedPastePage",
"automationId": "AdvancedPaste_DisableAIButton",
"controlType": "Button"
},
{
"pageName": "AdvancedPastePage",
"automationId": "AdvancedPaste_EnableAdvancedAI",
"controlType": "SettingsCard"
},
{
"pageName": "AdvancedPastePage",
"automationId": "AdvancedPaste_EnableAIButton",
"controlType": "Button"
},
{
"pageName": "AdvancedPastePage",
"automationId": "AdvancedPaste_EnableAIDialog_ConfigureOpenAIKey",
"controlType": "TextBlock"
},
{
"pageName": "AdvancedPastePage",
"automationId": "AdvancedPaste_EnableAISettingsCard",
"controlType": "SettingsCard"
},
{
"pageName": "AdvancedPastePage",
"automationId": "AdvancedPaste_EnableAISettingsCardDescription",
"controlType": "TextBlock"
},
{
"pageName": "AdvancedPastePage",
"automationId": "AdvancedPaste_EnableAISettingsGroup",
"controlType": "SettingsGroup"
},
{
"pageName": "AdvancedPastePage",
"automationId": "AdvancedPaste_EnableToggleControl_HeaderText",
"controlType": "SettingsCard"
},
{
"pageName": "AdvancedPastePage",
"automationId": "AdvancedPaste_ShowCustomPreviewSettingsCard",
"controlType": "SettingsCard"
},
{
"pageName": "AdvancedPastePage",
"automationId": "AdvancedPasteUI_Actions",
"controlType": "SettingsCard"
},
{
"pageName": "AdvancedPastePage",
"automationId": "AdvancedPasteUI_AddCustomActionButton",
"controlType": "Button"
},
{
"pageName": "AdvancedPastePage",
"automationId": "AdvancedPasteUI_Shortcut",
"controlType": "SettingsCard"
},
{
"pageName": "AdvancedPastePage",
"automationId": "Enable_CustomAction",
"controlType": "ToggleSwitch"
},
{
"pageName": "AdvancedPastePage",
"automationId": "ImageToText",
"controlType": "SettingsCard"
},
{
"pageName": "AdvancedPastePage",
"automationId": "More_Options_Button",
"controlType": "Button"
},
{
"pageName": "AdvancedPastePage",
"automationId": "PasteAsFile",
"controlType": "SettingsExpander"
},
{
"pageName": "AdvancedPastePage",
"automationId": "PasteAsHtmlFile",
"controlType": "SettingsCard"
},
{
"pageName": "AdvancedPastePage",
"automationId": "PasteAsJson_Shortcut",
"controlType": "SettingsCard"
},
{
"pageName": "AdvancedPastePage",
"automationId": "PasteAsMarkdown_Shortcut",
"controlType": "SettingsCard"
},
{
"pageName": "AdvancedPastePage",
"automationId": "PasteAsPlainText_Shortcut",
"controlType": "SettingsCard"
},
{
"pageName": "AdvancedPastePage",
"automationId": "PasteAsPngFile",
"controlType": "SettingsCard"
},
{
"pageName": "AdvancedPastePage",
"automationId": "PasteAsTxtFile",
"controlType": "SettingsCard"
},
{
"pageName": "AdvancedPastePage",
"automationId": "ToggleSwitch",
"controlType": "ToggleSwitch"
},
{
"pageName": "AdvancedPastePage",
"automationId": "Transcode",
"controlType": "SettingsExpander"
},
{
"pageName": "AdvancedPastePage",
"automationId": "TranscodeToMp3",
"controlType": "SettingsCard"
},
{
"pageName": "AdvancedPastePage",
"automationId": "TranscodeToMp4",
"controlType": "SettingsCard"
},
{
"pageName": "AlwaysOnTopPage",
"automationId": "AlwaysOnTop_Activation_GroupSettings",

View File

@ -2,15 +2,19 @@
// The Microsoft Corporation licenses this file to you under the MIT license.
// See the LICENSE file in the project root for more information.
using System;
using System.Numerics;
using System.Threading.Tasks;
using Microsoft.UI.Xaml;
using Microsoft.UI.Xaml.Automation;
using Microsoft.UI.Xaml.Controls;
using Microsoft.UI.Xaml.Hosting;
using Microsoft.UI.Xaml.Media;
using Windows.Foundation;
namespace Microsoft.PowerToys.Settings.UI.Helpers;
public abstract class NavigatablePage : Page
public abstract partial class NavigatablePage : Page
{
private string _pendingElementKey;
@ -45,22 +49,91 @@ public abstract class NavigatablePage : Page
protected virtual async Task OnTargetElementNavigatedAsync(FrameworkElement target, string elementKey)
{
if (target == null)
{
return;
}
// Get the visual and compositor
var visual = ElementCompositionPreview.GetElementVisual(target);
var compositor = visual.Compositor;
// Create a subtle glow effect using drop shadow
var dropShadow = compositor.CreateDropShadow();
dropShadow.Color = Microsoft.UI.Colors.Gold;
dropShadow.BlurRadius = 15f;
dropShadow.Opacity = 0f;
dropShadow.Offset = new Vector3(0, 0, 0);
var spriteVisual = compositor.CreateSpriteVisual();
spriteVisual.Size = new Vector2((float)target.ActualWidth + 30, (float)target.ActualHeight + 30);
spriteVisual.Shadow = dropShadow;
spriteVisual.Offset = new Vector3(-15, -15, 0);
// Insert the shadow visual behind the target element
ElementCompositionPreview.SetElementChildVisual(target, spriteVisual);
// Create smooth animations with more natural easing
var fadeInAnimation = compositor.CreateScalarKeyFrameAnimation();
fadeInAnimation.InsertKeyFrame(0f, 0f);
fadeInAnimation.InsertKeyFrame(0.4f, 0.6f, compositor.CreateCubicBezierEasingFunction(new Vector2(0.25f, 0.1f), new Vector2(0.25f, 1f)));
fadeInAnimation.InsertKeyFrame(1f, 0f, compositor.CreateCubicBezierEasingFunction(new Vector2(0.25f, 0f), new Vector2(0.75f, 0.9f)));
fadeInAnimation.Duration = TimeSpan.FromMilliseconds(800);
// Create a subtle scale animation
var scaleAnimation = compositor.CreateVector3KeyFrameAnimation();
scaleAnimation.InsertKeyFrame(0f, new Vector3(1f, 1f, 1f));
scaleAnimation.InsertKeyFrame(0.3f, new Vector3(1.015f, 1.015f, 1f), compositor.CreateCubicBezierEasingFunction(new Vector2(0.25f, 0.1f), new Vector2(0.25f, 1f)));
scaleAnimation.InsertKeyFrame(1f, new Vector3(1f, 1f, 1f), compositor.CreateCubicBezierEasingFunction(new Vector2(0.25f, 0f), new Vector2(0.75f, 0.9f)));
scaleAnimation.Duration = TimeSpan.FromMilliseconds(400);
// Create a subtle blur radius animation for pulsing effect
var blurAnimation = compositor.CreateScalarKeyFrameAnimation();
blurAnimation.InsertKeyFrame(0f, 15f);
blurAnimation.InsertKeyFrame(0.4f, 25f, compositor.CreateCubicBezierEasingFunction(new Vector2(0.25f, 0.1f), new Vector2(0.25f, 1f)));
blurAnimation.InsertKeyFrame(1f, 15f, compositor.CreateCubicBezierEasingFunction(new Vector2(0.25f, 0f), new Vector2(0.75f, 0.9f)));
blurAnimation.Duration = TimeSpan.FromMilliseconds(800);
// Apply animations
dropShadow.StartAnimation("Opacity", fadeInAnimation);
dropShadow.StartAnimation("BlurRadius", blurAnimation);
visual.StartAnimation("Scale", scaleAnimation);
// If it's a control, add a subtle background highlight
if (target is Control ctrl)
{
var oldBrush = ctrl.BorderBrush;
var oldThickness = ctrl.BorderThickness;
var originalBackground = ctrl.Background;
ctrl.BorderBrush = new Microsoft.UI.Xaml.Media.SolidColorBrush(Microsoft.UI.Colors.OrangeRed);
ctrl.BorderThickness = new Microsoft.UI.Xaml.Thickness(2);
// Create a gradient brush for modern highlight effect
var gradientBrush = new LinearGradientBrush();
gradientBrush.StartPoint = new Point(0, 0);
gradientBrush.EndPoint = new Point(1, 1);
await Task.Delay(1000);
var color1 = Microsoft.UI.Colors.LightGoldenrodYellow;
color1.A = 20; // Very subtle
var color2 = Microsoft.UI.Colors.PaleGoldenrod;
color2.A = 15; // Even more subtle
ctrl.BorderBrush = oldBrush;
ctrl.BorderThickness = oldThickness;
gradientBrush.GradientStops.Add(new GradientStop { Color = color1, Offset = 0 });
gradientBrush.GradientStops.Add(new GradientStop { Color = color2, Offset = 1 });
// Apply the highlight
ctrl.Background = gradientBrush;
// Wait for animation to complete
await Task.Delay(800);
// Restore original background
ctrl.Background = originalBackground;
}
else
{
// For non-control elements, just wait for the glow animation
await Task.Delay(800);
}
// Clean up the shadow visual
ElementCompositionPreview.SetElementChildVisual(target, null);
}
protected static FrameworkElement FindElementByAutomationId(DependencyObject root, string automationId)

View File

@ -162,7 +162,7 @@
</ItemGroup>
<Target Name="GenerateXamlSearchIndex" BeforeTargets="PrepareResourceNames" Inputs="@(Page->'%(FullPath)')" Outputs="$(GeneratedJsonFile)">
<MSBuild Projects="..\Settings.UI.XamlIndexBuilder\Settings.UI.XamlIndexBuilder.csproj" Targets="Publish" Properties="Configuration=$(Configuration);&#xD;&#xA; RuntimeIdentifier=win-x64;&#xD;&#xA; SelfContained=true;&#xD;&#xA; PublishSingleFile=true;&#xD;&#xA; PublishDir=$(IndexerPublishDir)">
<MSBuild Projects="..\Settings.UI.XamlIndexBuilder\Settings.UI.XamlIndexBuilder.csproj" Targets="Publish" Properties="Configuration=$(Configuration);&#xD;&#xA; SelfContained=true;&#xD;&#xA; PublishSingleFile=true;&#xD;&#xA; PublishDir=$(IndexerPublishDir)">
<Output TaskParameter="TargetOutputs" ItemName="IndexerPublishOutputs" />
</MSBuild>

View File

@ -1,5 +1,6 @@
<Page
<local:NavigatablePage
x:Class="Microsoft.PowerToys.Settings.UI.Views.AdvancedPastePage"
xmlns:local="using:Microsoft.PowerToys.Settings.UI.Helpers"
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:controls="using:Microsoft.PowerToys.Settings.UI.Controls"
@ -11,7 +12,7 @@
x:Name="RootPage"
AutomationProperties.LandmarkType="Main"
mc:Ignorable="d">
<Page.Resources>
<local:NavigatablePage.Resources>
<ResourceDictionary>
<ResourceDictionary.ThemeDictionaries>
<ResourceDictionary x:Key="Default">
@ -37,7 +38,7 @@
</StackPanel>
</DataTemplate>
</ResourceDictionary>
</Page.Resources>
</local:NavigatablePage.Resources>
<Grid>
<controls:SettingsPageControl x:Uid="AdvancedPaste"
AutomationProperties.AutomationId="AdvancedPaste" ModuleImageSource="ms-appx:///Assets/Settings/Modules/AdvancedPaste.png">
@ -497,4 +498,4 @@
</StackPanel>
</ContentDialog>
</Grid>
</Page>
</local:NavigatablePage>

View File

@ -15,7 +15,7 @@ using Microsoft.UI.Xaml.Controls;
namespace Microsoft.PowerToys.Settings.UI.Views
{
public sealed partial class AdvancedPastePage : Page, IRefreshablePage
public sealed partial class AdvancedPastePage : NavigatablePage, IRefreshablePage
{
private AdvancedPasteViewModel ViewModel { get; set; }

View File

@ -1,5 +1,6 @@
<Page
<local:NavigatablePage
x:Class="Microsoft.PowerToys.Settings.UI.Views.AlwaysOnTopPage"
xmlns:local="using:Microsoft.PowerToys.Settings.UI.Helpers"
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:controls="using:Microsoft.PowerToys.Settings.UI.Controls"
@ -160,4 +161,4 @@
AutomationProperties.AutomationId="LearnMore_AlwaysOnTop" Link="https://aka.ms/PowerToysOverview_AlwaysOnTop" />
</controls:SettingsPageControl.PrimaryLinks>
</controls:SettingsPageControl>
</Page>
</local:NavigatablePage>

View File

@ -9,7 +9,7 @@ using Microsoft.UI.Xaml.Controls;
namespace Microsoft.PowerToys.Settings.UI.Views
{
public sealed partial class AlwaysOnTopPage : Page, IRefreshablePage
public sealed partial class AlwaysOnTopPage : NavigatablePage, IRefreshablePage
{
private AlwaysOnTopViewModel ViewModel { get; set; }

View File

@ -1,5 +1,6 @@
<Page
<local:NavigatablePage
x:Class="Microsoft.PowerToys.Settings.UI.Views.AwakePage"
xmlns:local="using:Microsoft.PowerToys.Settings.UI.Helpers"
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:controls="using:Microsoft.PowerToys.Settings.UI.Controls"
@ -13,9 +14,9 @@
AutomationProperties.LandmarkType="Main"
mc:Ignorable="d">
<Page.Resources>
<local:NavigatablePage.Resources>
<converters:AwakeModeToIntConverter x:Key="AwakeModeToIntConverter" />
</Page.Resources>
</local:NavigatablePage.Resources>
<controls:SettingsPageControl
x:Uid="Awake"
@ -138,4 +139,4 @@
AutomationProperties.AutomationId="SecondaryLink_Awake" Link="https://awake.den.dev" />
</controls:SettingsPageControl.SecondaryLinks>
</controls:SettingsPageControl>
</Page>
</local:NavigatablePage>

View File

@ -17,7 +17,7 @@ using PowerToys.GPOWrapper;
namespace Microsoft.PowerToys.Settings.UI.Views
{
public sealed partial class AwakePage : Page, IRefreshablePage
public sealed partial class AwakePage : NavigatablePage, IRefreshablePage
{
private readonly string _appName = "Awake";
private readonly SettingsUtils _settingsUtils;

View File

@ -1,5 +1,6 @@
<Page
<local:NavigatablePage
x:Class="Microsoft.PowerToys.Settings.UI.Views.CmdNotFoundPage"
xmlns:local="using:Microsoft.PowerToys.Settings.UI.Helpers"
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:controls="using:Microsoft.PowerToys.Settings.UI.Controls"
@ -10,13 +11,13 @@
xmlns:ui="using:CommunityToolkit.WinUI"
AutomationProperties.LandmarkType="Main"
mc:Ignorable="d">
<Page.Resources>
<local:NavigatablePage.Resources>
<tkconverters:BoolToVisibilityConverter
x:Key="BoolToInvertedVisibilityConverter"
FalseValue="Visible"
TrueValue="Collapsed" />
<tkconverters:BoolToVisibilityConverter x:Key="BoolToVisibilityConverter" />
</Page.Resources>
</local:NavigatablePage.Resources>
<controls:SettingsPageControl x:Uid="CmdNotFound"
AutomationProperties.AutomationId="CmdNotFound" ModuleImageSource="ms-appx:///Assets/Settings/Modules/CmdNotFound.png">
<controls:SettingsPageControl.ModuleContent>
@ -209,4 +210,4 @@
AutomationProperties.AutomationId="LearnMore_CmdNotFound" Link="https://aka.ms/PowerToysOverview_CmdNotFound" />
</controls:SettingsPageControl.PrimaryLinks>
</controls:SettingsPageControl>
</Page>
</local:NavigatablePage>

View File

@ -2,12 +2,13 @@
// The Microsoft Corporation licenses this file to you under the MIT license.
// See the LICENSE file in the project root for more information.
using Microsoft.PowerToys.Settings.UI.Helpers;
using Microsoft.PowerToys.Settings.UI.ViewModels;
using Microsoft.UI.Xaml.Controls;
namespace Microsoft.PowerToys.Settings.UI.Views
{
public sealed partial class CmdNotFoundPage : Page
public sealed partial class CmdNotFoundPage : NavigatablePage
{
private CmdNotFoundViewModel ViewModel { get; set; }

View File

@ -1,5 +1,6 @@
<Page
<local:NavigatablePage
x:Class="Microsoft.PowerToys.Settings.UI.Views.CmdPalPage"
xmlns:local="using:Microsoft.PowerToys.Settings.UI.Helpers"
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:controls="using:Microsoft.PowerToys.Settings.UI.Controls"
@ -11,7 +12,7 @@
mc:Ignorable="d">
<controls:SettingsPageControl x:Uid="CmdPal"
AutomationProperties.AutomationId="CmdPal" ModuleImageSource="ms-appx:///Assets/Settings/Modules/CmdPal.png">
AutomationProperties.AutomationId="CmdPal" ModuleImageSource="ms-appx:///Assets/Settings/Modules/CmdPal.png">
<controls:SettingsPageControl.ModuleContent>
<StackPanel ChildrenTransitions="{StaticResource SettingsCardsAnimations}" Orientation="Vertical">
<tkcontrols:SettingsCard
@ -57,4 +58,4 @@
AutomationProperties.AutomationId="LearnMore_CmdPal" Link="https://aka.ms/PowerToysOverview_CmdPal" />
</controls:SettingsPageControl.PrimaryLinks>
</controls:SettingsPageControl>
</Page>
</local:NavigatablePage>

View File

@ -13,7 +13,7 @@ using Microsoft.UI.Xaml.Controls;
namespace Microsoft.PowerToys.Settings.UI.Views
{
public sealed partial class CmdPalPage : Page, IRefreshablePage
public sealed partial class CmdPalPage : NavigatablePage, IRefreshablePage
{
private CmdPalViewModel ViewModel { get; set; }

View File

@ -1,5 +1,6 @@
<Page
<local:NavigatablePage
x:Class="Microsoft.PowerToys.Settings.UI.Views.ColorPickerPage"
xmlns:local="using:Microsoft.PowerToys.Settings.UI.Helpers"
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:controls="using:Microsoft.PowerToys.Settings.UI.Controls"
@ -15,9 +16,9 @@
AutomationProperties.LandmarkType="Main"
mc:Ignorable="d">
<Page.Resources>
<local:NavigatablePage.Resources>
<tkconverters:BoolToVisibilityConverter x:Key="BoolToVis" />
</Page.Resources>
</local:NavigatablePage.Resources>
<controls:SettingsPageControl x:Uid="ColorPicker"
AutomationProperties.AutomationId="ColorPicker" ModuleImageSource="ms-appx:///Assets/Settings/Modules/ColorPicker.png">
@ -226,4 +227,4 @@
<controls:PageLink Link="https://medium.com/@Niels9001/a-fluent-color-meter-for-powertoys-20407ededf0c" Text="Niels Laute's UX concept" />
</controls:SettingsPageControl.SecondaryLinks>
</controls:SettingsPageControl>
</Page>
</local:NavigatablePage>

View File

@ -15,7 +15,7 @@ using Microsoft.Windows.ApplicationModel.Resources;
namespace Microsoft.PowerToys.Settings.UI.Views
{
public sealed partial class ColorPickerPage : Page, IRefreshablePage
public sealed partial class ColorPickerPage : NavigatablePage, IRefreshablePage
{
public ColorPickerViewModel ViewModel { get; set; }

View File

@ -1,5 +1,6 @@
<Page
<local:NavigatablePage
x:Class="Microsoft.PowerToys.Settings.UI.Views.CropAndLockPage"
xmlns:local="using:Microsoft.PowerToys.Settings.UI.Helpers"
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:controls="using:Microsoft.PowerToys.Settings.UI.Controls"
@ -69,4 +70,4 @@
<controls:PageLink Link="https://github.com/kevinguo305" Text="Kevin Guo" />
</controls:SettingsPageControl.SecondaryLinks>
</controls:SettingsPageControl>
</Page>
</local:NavigatablePage>

View File

@ -9,7 +9,7 @@ using Microsoft.UI.Xaml.Controls;
namespace Microsoft.PowerToys.Settings.UI.Views
{
public sealed partial class CropAndLockPage : Page, IRefreshablePage
public sealed partial class CropAndLockPage : NavigatablePage, IRefreshablePage
{
private CropAndLockViewModel ViewModel { get; set; }

View File

@ -1,5 +1,6 @@
<Page
<local:NavigatablePage
x:Class="Microsoft.PowerToys.Settings.UI.Views.DashboardPage"
xmlns:local="using:Microsoft.PowerToys.Settings.UI.Helpers"
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:Lib="using:Microsoft.PowerToys.Settings.UI.Library"
@ -14,7 +15,7 @@
DataContext="DashboardViewModel"
mc:Ignorable="d">
<Page.Resources>
<local:NavigatablePage.Resources>
<DataTemplate x:Key="KeyVisualTemplate">
<controls:KeyVisual
VerticalAlignment="Center"
@ -288,7 +289,7 @@
</Button.Flyout>
</Button>
</DataTemplate>
</Page.Resources>
</local:NavigatablePage.Resources>
<Grid Margin="16,0,0,0" RowSpacing="24">
<Grid.RowDefinitions>
<RowDefinition Height="Auto" />
@ -524,4 +525,4 @@
</ScrollViewer>
</Grid>
</Page>
</local:NavigatablePage>

View File

@ -20,7 +20,7 @@ namespace Microsoft.PowerToys.Settings.UI.Views
/// <summary>
/// Dashboard Settings Page.
/// </summary>
public sealed partial class DashboardPage : Page, IRefreshablePage
public sealed partial class DashboardPage : NavigatablePage, IRefreshablePage
{
/// <summary>
/// Gets or sets view model.

View File

@ -1,5 +1,6 @@
<Page
<local:NavigatablePage
x:Class="Microsoft.PowerToys.Settings.UI.Views.EnvironmentVariablesPage"
xmlns:local="using:Microsoft.PowerToys.Settings.UI.Helpers"
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:controls="using:Microsoft.PowerToys.Settings.UI.Controls"
@ -62,4 +63,4 @@
AutomationProperties.AutomationId="LearnMore_EnvironmentVariables" Link="https://aka.ms/PowerToysOverview_EnvironmentVariables" />
</controls:SettingsPageControl.PrimaryLinks>
</controls:SettingsPageControl>
</Page>
</local:NavigatablePage>

View File

@ -9,7 +9,7 @@ using Microsoft.UI.Xaml.Controls;
namespace Microsoft.PowerToys.Settings.UI.Views
{
public sealed partial class EnvironmentVariablesPage : Page, IRefreshablePage
public sealed partial class EnvironmentVariablesPage : NavigatablePage, IRefreshablePage
{
private EnvironmentVariablesViewModel ViewModel { get; }

View File

@ -1,5 +1,6 @@
<Page
<local:NavigatablePage
x:Class="Microsoft.PowerToys.Settings.UI.Views.FancyZonesPage"
xmlns:local="using:Microsoft.PowerToys.Settings.UI.Helpers"
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:controls="using:Microsoft.PowerToys.Settings.UI.Controls"
@ -327,4 +328,4 @@
AutomationProperties.AutomationId="LearnMore_FancyZones" Link="https://aka.ms/PowerToysOverview_FancyZones" />
</controls:SettingsPageControl.PrimaryLinks>
</controls:SettingsPageControl>
</Page>
</local:NavigatablePage>

View File

@ -9,7 +9,7 @@ using Microsoft.UI.Xaml.Controls;
namespace Microsoft.PowerToys.Settings.UI.Views
{
public sealed partial class FancyZonesPage : Page, IRefreshablePage
public sealed partial class FancyZonesPage : NavigatablePage, IRefreshablePage
{
private FancyZonesViewModel ViewModel { get; set; }

View File

@ -1,5 +1,6 @@
<Page
<local:NavigatablePage
x:Class="Microsoft.PowerToys.Settings.UI.Views.FileLocksmithPage"
xmlns:local="using:Microsoft.PowerToys.Settings.UI.Helpers"
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:controls="using:Microsoft.PowerToys.Settings.UI.Controls"
@ -63,4 +64,4 @@
AutomationProperties.AutomationId="LearnMore_FileLocksmith" Link="https://aka.ms/PowerToysOverview_FileLocksmith" />
</controls:SettingsPageControl.PrimaryLinks>
</controls:SettingsPageControl>
</Page>
</local:NavigatablePage>

View File

@ -9,7 +9,7 @@ using Microsoft.UI.Xaml.Controls;
namespace Microsoft.PowerToys.Settings.UI.Views
{
public sealed partial class FileLocksmithPage : Page, IRefreshablePage
public sealed partial class FileLocksmithPage : NavigatablePage, IRefreshablePage
{
private FileLocksmithViewModel ViewModel { get; set; }

View File

@ -1,5 +1,6 @@
<Page
<local:NavigatablePage
x:Class="Microsoft.PowerToys.Settings.UI.Views.GeneralPage"
xmlns:local="using:Microsoft.PowerToys.Settings.UI.Helpers"
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:controls="using:Microsoft.PowerToys.Settings.UI.Controls"
@ -11,10 +12,10 @@
AutomationProperties.LandmarkType="Main"
mc:Ignorable="d">
<Page.Resources>
<local:NavigatablePage.Resources>
<converters:UpdateStateToBoolConverter x:Key="UpdateStateToBoolConverter" />
<converters:StringToInfoBarSeverityConverter x:Key="StringToInfoBarSeverityConverter" />
</Page.Resources>
</local:NavigatablePage.Resources>
<controls:SettingsPageControl x:Uid="General"
AutomationProperties.AutomationId="General" ModuleImageSource="ms-appx:///Assets/Settings/Modules/PT.png">
@ -573,4 +574,4 @@
AutomationProperties.AutomationId="OpenSource_Notice" Link="https://github.com/microsoft/PowerToys/blob/main/NOTICE.md" />
</controls:SettingsPageControl.SecondaryLinks>
</controls:SettingsPageControl>
</Page>
</local:NavigatablePage>

View File

@ -18,7 +18,7 @@ namespace Microsoft.PowerToys.Settings.UI.Views
/// <summary>
/// General Settings Page.
/// </summary>
public sealed partial class GeneralPage : Page, IRefreshablePage
public sealed partial class GeneralPage : NavigatablePage, IRefreshablePage
{
private static DateTime OkToHideBackupAndRestoreMessageTime { get; set; }

View File

@ -1,5 +1,6 @@
<Page
<local:NavigatablePage
x:Class="Microsoft.PowerToys.Settings.UI.Views.HostsPage"
xmlns:local="using:Microsoft.PowerToys.Settings.UI.Helpers"
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:controls="using:Microsoft.PowerToys.Settings.UI.Controls"
@ -94,4 +95,4 @@
AutomationProperties.AutomationId="LearnMore_Hosts" Link="https://aka.ms/PowerToysOverview_HostsFileEditor" />
</controls:SettingsPageControl.PrimaryLinks>
</controls:SettingsPageControl>
</Page>
</local:NavigatablePage>

View File

@ -9,7 +9,7 @@ using Microsoft.UI.Xaml.Controls;
namespace Microsoft.PowerToys.Settings.UI.Views
{
public sealed partial class HostsPage : Page, IRefreshablePage
public sealed partial class HostsPage : NavigatablePage, IRefreshablePage
{
private HostsViewModel ViewModel { get; }

View File

@ -1,5 +1,6 @@
<Page
<local:NavigatablePage
x:Class="Microsoft.PowerToys.Settings.UI.Views.ImageResizerPage"
xmlns:local="using:Microsoft.PowerToys.Settings.UI.Helpers"
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:controls="using:Microsoft.PowerToys.Settings.UI.Controls"
@ -13,7 +14,7 @@
x:Name="RootPage"
AutomationProperties.LandmarkType="Main"
mc:Ignorable="d">
<Page.Resources>
<local:NavigatablePage.Resources>
<converters:ImageResizerFitToStringConverter x:Key="ImageResizerFitToStringConverter" />
<converters:ImageResizerFitToIntConverter x:Key="ImageResizerFitToIntConverter" />
<converters:ImageResizerUnitToStringConverter x:Key="ImageResizerUnitToStringConverter" />
@ -26,7 +27,7 @@
x:Key="BoolToComboBoxIndexConverter"
FalseValue="1"
TrueValue="0" />
</Page.Resources>
</local:NavigatablePage.Resources>
<controls:SettingsPageControl x:Uid="ImageResizer"
AutomationProperties.AutomationId="ImageResizer" ModuleImageSource="ms-appx:///Assets/Settings/Modules/ImageResizer.png">
<controls:SettingsPageControl.ModuleContent>
@ -372,4 +373,4 @@
<controls:PageLink Link="https://github.com/bricelam/ImageResizer/" Text="Brice Lambson's ImageResizer" />
</controls:SettingsPageControl.SecondaryLinks>
</controls:SettingsPageControl>
</Page>
</local:NavigatablePage>

View File

@ -14,7 +14,7 @@ using Microsoft.UI.Xaml.Controls;
namespace Microsoft.PowerToys.Settings.UI.Views
{
public sealed partial class ImageResizerPage : Page, IRefreshablePage
public sealed partial class ImageResizerPage : NavigatablePage, IRefreshablePage
{
public ImageResizerViewModel ViewModel { get; set; }

View File

@ -1,5 +1,6 @@
<Page
<local:NavigatablePage
x:Class="Microsoft.PowerToys.Settings.UI.Views.KeyboardManagerPage"
xmlns:local="using:Microsoft.PowerToys.Settings.UI.Helpers"
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:Lib="using:Microsoft.PowerToys.Settings.UI.Library"
@ -12,7 +13,7 @@
AutomationProperties.LandmarkType="Main"
mc:Ignorable="d">
<Page.Resources>
<local:NavigatablePage.Resources>
<tkconverters:CollectionVisibilityConverter x:Key="CollectionVisibilityConverter" />
<tkconverters:BoolToVisibilityConverter
x:Key="BoolToInvertedVisibilityConverter"
@ -53,7 +54,7 @@
Height="56">
</DataTemplate>-->
</Page.Resources>
</local:NavigatablePage.Resources>
<controls:SettingsPageControl x:Uid="KeyboardManager"
AutomationProperties.AutomationId="KeyboardManager" ModuleImageSource="ms-appx:///Assets/Settings/Modules/KBM.png">
@ -262,4 +263,4 @@
AutomationProperties.AutomationId="LearnMore_KBM" Link="https://aka.ms/PowerToysOverview_KeyboardManager" />
</controls:SettingsPageControl.PrimaryLinks>
</controls:SettingsPageControl>
</Page>
</local:NavigatablePage>

View File

@ -18,7 +18,7 @@ namespace Microsoft.PowerToys.Settings.UI.Views
/// <summary>
/// An empty page that can be used on its own or navigated to within a Frame.
/// </summary>
public sealed partial class KeyboardManagerPage : Page, IRefreshablePage
public sealed partial class KeyboardManagerPage : NavigatablePage, IRefreshablePage
{
private const string PowerToyName = "Keyboard Manager";

View File

@ -1,5 +1,6 @@
<Page
<local:NavigatablePage
x:Class="Microsoft.PowerToys.Settings.UI.Views.MeasureToolPage"
xmlns:local="using:Microsoft.PowerToys.Settings.UI.Helpers"
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:controls="using:Microsoft.PowerToys.Settings.UI.Controls"
@ -126,4 +127,4 @@
AutomationProperties.AutomationId="Attribution_Rooler" Link="https://github.com/peteblois/rooler" />
</controls:SettingsPageControl.SecondaryLinks>
</controls:SettingsPageControl>
</Page>
</local:NavigatablePage>

View File

@ -9,7 +9,7 @@ using Microsoft.UI.Xaml.Controls;
namespace Microsoft.PowerToys.Settings.UI.Views
{
public sealed partial class MeasureToolPage : Page, IRefreshablePage
public sealed partial class MeasureToolPage : NavigatablePage, IRefreshablePage
{
private MeasureToolViewModel ViewModel { get; set; }

View File

@ -1,5 +1,6 @@
<Page
<local:NavigatablePage
x:Class="Microsoft.PowerToys.Settings.UI.Views.MouseUtilsPage"
xmlns:local="using:Microsoft.PowerToys.Settings.UI.Helpers"
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:controls="using:Microsoft.PowerToys.Settings.UI.Controls"
@ -12,13 +13,13 @@
xmlns:ui="using:CommunityToolkit.WinUI"
AutomationProperties.LandmarkType="Main"
mc:Ignorable="d">
<Page.Resources>
<local:NavigatablePage.Resources>
<converters:IndexBitFieldToVisibilityConverter x:Key="IndexBitFieldToVisibilityConverter" />
<tkconverters:BoolToVisibilityConverter
x:Key="BoolToInvertedVisibilityConverter"
FalseValue="Visible"
TrueValue="Collapsed" />
</Page.Resources>
</local:NavigatablePage.Resources>
<controls:SettingsPageControl x:Uid="MouseUtils"
AutomationProperties.AutomationId="MouseUtils" ModuleImageSource="ms-appx:///Assets/Settings/Modules/MouseUtils.png">
<controls:SettingsPageControl.ModuleContent>
@ -444,4 +445,4 @@
<controls:PageLink Link="https://michael-clayton.com/projects/fancymouse" Text="Michael Clayton's Mouse Jump (FancyMouse)" />
</controls:SettingsPageControl.SecondaryLinks>
</controls:SettingsPageControl>
</Page>
</local:NavigatablePage>

View File

@ -12,7 +12,7 @@ using Microsoft.UI.Xaml.Controls;
namespace Microsoft.PowerToys.Settings.UI.Views
{
public sealed partial class MouseUtilsPage : Page, IRefreshablePage
public sealed partial class MouseUtilsPage : NavigatablePage, IRefreshablePage
{
private MouseUtilsViewModel ViewModel { get; set; }

View File

@ -1,5 +1,6 @@
<Page
<local:NavigatablePage
x:Class="Microsoft.PowerToys.Settings.UI.Views.MouseWithoutBordersPage"
xmlns:local="using:Microsoft.PowerToys.Settings.UI.Helpers"
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:controls="using:Microsoft.PowerToys.Settings.UI.Controls"
@ -10,13 +11,13 @@
xmlns:ui="using:CommunityToolkit.WinUI"
AutomationProperties.LandmarkType="Main"
mc:Ignorable="d">
<Page.Resources>
<local:NavigatablePage.Resources>
<converters:BoolToVisibilityConverter x:Key="negativeBoolToVisibilityConverter" />
<converters:BoolToObjectConverter
x:Key="OneRowMatrixBoolToNumberOfRowsConverter"
FalseValue="2"
TrueValue="4" />
</Page.Resources>
</local:NavigatablePage.Resources>
<controls:SettingsPageControl x:Uid="MouseWithoutBorders"
AutomationProperties.AutomationId="MouseWithoutBorders" ModuleImageSource="ms-appx:///Assets/Settings/Modules/MouseWithoutBorders.png">
<controls:SettingsPageControl.ModuleContent>
@ -520,4 +521,4 @@
<controls:PageLink Link="https://github.com/microsoft/PowerToys/blob/main/COMMUNITY.md#mouse-without-borders-original-contributors" Text="Truong Do (Đỗ Đức Trường) and other original contributors" />
</controls:SettingsPageControl.SecondaryLinks>
</controls:SettingsPageControl>
</Page>
</local:NavigatablePage>

View File

@ -21,7 +21,7 @@ using static Microsoft.PowerToys.Settings.UI.ViewModels.MouseWithoutBordersViewM
namespace Microsoft.PowerToys.Settings.UI.Views
{
public sealed partial class MouseWithoutBordersPage : Page, IRefreshablePage
public sealed partial class MouseWithoutBordersPage : NavigatablePage, IRefreshablePage
{
private const string MouseWithoutBordersDragDropCheckString = "MWB Device Drag Drop";

View File

@ -1,5 +1,6 @@
<Page
<helper:NavigatablePage
x:Class="Microsoft.PowerToys.Settings.UI.Views.NewPlusPage"
xmlns:helper="using:Microsoft.PowerToys.Settings.UI.Helpers"
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:controls="using:Microsoft.PowerToys.Settings.UI.Controls"
@ -243,4 +244,4 @@
</controls:SettingsPageControl.SecondaryLinks>
</controls:SettingsPageControl>
</Page>
</helper:NavigatablePage>

View File

@ -9,7 +9,7 @@ using Microsoft.UI.Xaml.Controls;
namespace Microsoft.PowerToys.Settings.UI.Views
{
public sealed partial class NewPlusPage : Page, IRefreshablePage
public sealed partial class NewPlusPage : NavigatablePage, IRefreshablePage
{
private NewPlusViewModel ViewModel { get; set; }

View File

@ -1,5 +1,6 @@
<Page
<local:NavigatablePage
x:Class="Microsoft.PowerToys.Settings.UI.Views.PeekPage"
xmlns:local="using:Microsoft.PowerToys.Settings.UI.Helpers"
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:controls="using:Microsoft.PowerToys.Settings.UI.Controls"
@ -110,4 +111,4 @@
AutomationProperties.AutomationId="LearnMore_Peek" Link="https://aka.ms/PowerToysOverview_Peek" />
</controls:SettingsPageControl.PrimaryLinks>
</controls:SettingsPageControl>
</Page>
</local:NavigatablePage>

View File

@ -9,7 +9,7 @@ using Microsoft.UI.Xaml.Controls;
namespace Microsoft.PowerToys.Settings.UI.Views
{
public sealed partial class PeekPage : Page, IRefreshablePage
public sealed partial class PeekPage : NavigatablePage, IRefreshablePage
{
private PeekViewModel ViewModel { get; set; }

View File

@ -1,5 +1,6 @@
<Page
<local:NavigatablePage
x:Class="Microsoft.PowerToys.Settings.UI.Views.PowerAccentPage"
xmlns:local="using:Microsoft.PowerToys.Settings.UI.Helpers"
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:Lib="using:Microsoft.PowerToys.Settings.UI.Library"
@ -10,7 +11,7 @@
xmlns:ui="using:CommunityToolkit.WinUI"
AutomationProperties.LandmarkType="Main"
mc:Ignorable="d">
<Page.Resources>
<local:NavigatablePage.Resources>
<CollectionViewSource
x:Name="LanguagesCustomViewSource"
IsSourceGrouped="True"
@ -18,7 +19,7 @@
<DataTemplate x:Key="LanguageViewTemplate" x:DataType="Lib:PowerAccentLanguageModel">
<TextBlock Text="{x:Bind Language}" />
</DataTemplate>
</Page.Resources>
</local:NavigatablePage.Resources>
<controls:SettingsPageControl
x:Uid="QuickAccent"
@ -262,4 +263,4 @@
<controls:PageLink Link="https://github.com/damienleroy/PowerAccent" Text="Damien Leroy's PowerAccent" />
</controls:SettingsPageControl.SecondaryLinks>
</controls:SettingsPageControl>
</Page>
</local:NavigatablePage>

View File

@ -11,7 +11,7 @@ using Microsoft.UI.Xaml.Controls;
namespace Microsoft.PowerToys.Settings.UI.Views
{
public sealed partial class PowerAccentPage : Page, IRefreshablePage
public sealed partial class PowerAccentPage : NavigatablePage, IRefreshablePage
{
private PowerAccentViewModel ViewModel { get; set; }

View File

@ -1,5 +1,6 @@
<Page
<local:NavigatablePage
x:Class="Microsoft.PowerToys.Settings.UI.Views.PowerLauncherPage"
xmlns:local="using:Microsoft.PowerToys.Settings.UI.Helpers"
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:ViewModels="using:Microsoft.PowerToys.Settings.UI.ViewModels"
@ -14,7 +15,7 @@
AutomationProperties.LandmarkType="Main"
mc:Ignorable="d">
<Page.Resources>
<local:NavigatablePage.Resources>
<Style x:Key="OptionSeparator" TargetType="Rectangle">
<Setter Property="Height" Value="1" />
<Setter Property="HorizontalAlignment" Value="Stretch" />
@ -303,7 +304,7 @@
<DataTemplate x:Key="EmptyTemplate" x:DataType="ViewModels:PluginAdditionalOptionViewModel">
<StackPanel HorizontalAlignment="Stretch" Orientation="Vertical" />
</DataTemplate>
</Page.Resources>
</local:NavigatablePage.Resources>
<controls:SettingsPageControl x:Uid="PowerLauncher"
AutomationProperties.AutomationId="PowerLauncher" ModuleImageSource="ms-appx:///Assets/Settings/Modules/Run.png">
@ -857,4 +858,4 @@
<controls:PageLink Link="https://github.com/betsegaw/windowwalker/" Text="Beta Tadele's Window Walker" />
</controls:SettingsPageControl.SecondaryLinks>
</controls:SettingsPageControl>
</Page>
</local:NavigatablePage>

View File

@ -15,7 +15,7 @@ using Microsoft.UI.Xaml.Controls;
namespace Microsoft.PowerToys.Settings.UI.Views
{
public sealed partial class PowerLauncherPage : Page, IRefreshablePage
public sealed partial class PowerLauncherPage : NavigatablePage, IRefreshablePage
{
public PowerLauncherViewModel ViewModel { get; set; }

View File

@ -1,5 +1,6 @@
<Page
<local:NavigatablePage
x:Class="Microsoft.PowerToys.Settings.UI.Views.PowerOcrPage"
xmlns:local="using:Microsoft.PowerToys.Settings.UI.Helpers"
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:controls="using:Microsoft.PowerToys.Settings.UI.Controls"
@ -89,4 +90,4 @@
<controls:PageLink Link="https://github.com/TheJoeFin/Text-Grab" Text="Based upon Joseph Finney's Text Grab" />
</controls:SettingsPageControl.SecondaryLinks>
</controls:SettingsPageControl>
</Page>
</local:NavigatablePage>

View File

@ -9,7 +9,7 @@ using Microsoft.UI.Xaml.Controls;
namespace Microsoft.PowerToys.Settings.UI.Views
{
public sealed partial class PowerOcrPage : Page, IRefreshablePage
public sealed partial class PowerOcrPage : NavigatablePage, IRefreshablePage
{
private PowerOcrViewModel ViewModel { get; set; }

View File

@ -1,5 +1,6 @@
<Page
<local:NavigatablePage
x:Class="Microsoft.PowerToys.Settings.UI.Views.PowerPreviewPage"
xmlns:local="using:Microsoft.PowerToys.Settings.UI.Helpers"
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:controls="using:Microsoft.PowerToys.Settings.UI.Controls"
@ -324,4 +325,4 @@
<controls:PageLink Link="https://www.pedrolamas.com" Text="Pedro Lamas's work on G-Code, STL, and QOI" />
</controls:SettingsPageControl.SecondaryLinks>
</controls:SettingsPageControl>
</Page>
</local:NavigatablePage>

View File

@ -2,6 +2,7 @@
// The Microsoft Corporation licenses this file to you under the MIT license.
// See the LICENSE file in the project root for more information.
using Microsoft.PowerToys.Settings.UI.Helpers;
using Microsoft.PowerToys.Settings.UI.Library;
using Microsoft.PowerToys.Settings.UI.ViewModels;
using Microsoft.UI.Xaml.Controls;
@ -11,7 +12,7 @@ namespace Microsoft.PowerToys.Settings.UI.Views
/// <summary>
/// An empty page that can be used on its own or navigated to within a Frame.
/// </summary>
public sealed partial class PowerPreviewPage : Page
public sealed partial class PowerPreviewPage : NavigatablePage
{
public PowerPreviewViewModel ViewModel { get; set; }

View File

@ -1,5 +1,6 @@
<Page
<local:NavigatablePage
x:Class="Microsoft.PowerToys.Settings.UI.Views.PowerRenamePage"
xmlns:local="using:Microsoft.PowerToys.Settings.UI.Helpers"
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:controls="using:Microsoft.PowerToys.Settings.UI.Controls"
@ -109,4 +110,4 @@
<controls:PageLink Link="https://github.com/chrdavis/SmartRename" Text="Chris Davis's SmartRenamer" />
</controls:SettingsPageControl.SecondaryLinks>
</controls:SettingsPageControl>
</Page>
</local:NavigatablePage>

View File

@ -9,7 +9,7 @@ using Microsoft.UI.Xaml.Controls;
namespace Microsoft.PowerToys.Settings.UI.Views
{
public sealed partial class PowerRenamePage : Page, IRefreshablePage
public sealed partial class PowerRenamePage : NavigatablePage, IRefreshablePage
{
private PowerRenameViewModel ViewModel { get; set; }

View File

@ -1,5 +1,6 @@
<Page
<local:NavigatablePage
x:Class="Microsoft.PowerToys.Settings.UI.Views.RegistryPreviewPage"
xmlns:local="using:Microsoft.PowerToys.Settings.UI.Helpers"
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:controls="using:Microsoft.PowerToys.Settings.UI.Controls"
@ -62,4 +63,4 @@
AutomationProperties.AutomationId="LearnMore_RegistryPreview" Link="https://aka.ms/PowerToysOverview_RegistryPreview" />
</controls:SettingsPageControl.PrimaryLinks>
</controls:SettingsPageControl>
</Page>
</local:NavigatablePage>

View File

@ -9,7 +9,7 @@ using Microsoft.UI.Xaml.Controls;
namespace Microsoft.PowerToys.Settings.UI.Views
{
public sealed partial class RegistryPreviewPage : Page, IRefreshablePage
public sealed partial class RegistryPreviewPage : NavigatablePage, IRefreshablePage
{
private RegistryPreviewViewModel ViewModel { get; set; }

View File

@ -508,7 +508,7 @@ namespace Microsoft.PowerToys.Settings.UI.Views
// First try to find a match in our detailed search results
var selectedText = args.ChosenSuggestion?.ToString() ?? queryText;
var searchHit = _currentSearchResults.FirstOrDefault(hit =>
selectedText.Contains(hit.Caption, StringComparison.OrdinalIgnoreCase));
selectedText.Equals($"{hit.Caption} ({hit.Module})", StringComparison.OrdinalIgnoreCase));
if (searchHit.PageType != null)
{
@ -519,22 +519,10 @@ namespace Microsoft.PowerToys.Settings.UI.Views
if (matchedNavItem != null)
{
NavigateToItem(matchedNavItem);
NavigateToItem(matchedNavItem, searchHit.Uid);
return;
}
}
// Fallback to module-level search
var matchedItem = ViewModel.NavItems
.FirstOrDefault(item =>
item.Content?.ToString()?
.Equals(queryText, StringComparison.OrdinalIgnoreCase) == true ||
selectedText.Contains(item.Content?.ToString() ?? string.Empty, StringComparison.OrdinalIgnoreCase));
if (matchedItem != null)
{
NavigateToItem(matchedItem);
}
}
private void NavigateToItem(NavigationViewItem item, string automationId = null)

View File

@ -1,5 +1,6 @@
<Page
<local:NavigatablePage
x:Class="Microsoft.PowerToys.Settings.UI.Views.ShortcutGuidePage"
xmlns:local="using:Microsoft.PowerToys.Settings.UI.Helpers"
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:controls="using:Microsoft.PowerToys.Settings.UI.Controls"
@ -158,4 +159,4 @@
AutomationProperties.AutomationId="LearnMore_ShortcutGuide" Link="https://aka.ms/PowerToysOverview_ShortcutGuide" />
</controls:SettingsPageControl.PrimaryLinks>
</controls:SettingsPageControl>
</Page>
</local:NavigatablePage>

View File

@ -9,7 +9,7 @@ using Microsoft.UI.Xaml.Controls;
namespace Microsoft.PowerToys.Settings.UI.Views
{
public sealed partial class ShortcutGuidePage : Page, IRefreshablePage
public sealed partial class ShortcutGuidePage : NavigatablePage, IRefreshablePage
{
private ShortcutGuideViewModel ViewModel { get; set; }

View File

@ -1,5 +1,6 @@
<Page
<local:NavigatablePage
x:Class="Microsoft.PowerToys.Settings.UI.Views.WorkspacesPage"
xmlns:local="using:Microsoft.PowerToys.Settings.UI.Helpers"
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:controls="using:Microsoft.PowerToys.Settings.UI.Controls"
@ -63,4 +64,4 @@
AutomationProperties.AutomationId="LearnMore_Workspaces" Link="https://aka.ms/PowerToysOverview_Workspaces" />
</controls:SettingsPageControl.PrimaryLinks>
</controls:SettingsPageControl>
</Page>
</local:NavigatablePage>

View File

@ -9,7 +9,7 @@ using Microsoft.UI.Xaml.Controls;
namespace Microsoft.PowerToys.Settings.UI.Views
{
public sealed partial class WorkspacesPage : Page, IRefreshablePage
public sealed partial class WorkspacesPage : NavigatablePage, IRefreshablePage
{
private WorkspacesViewModel ViewModel { get; set; }

View File

@ -1,5 +1,6 @@
<Page
<local:NavigatablePage
x:Class="Microsoft.PowerToys.Settings.UI.Views.ZoomItPage"
xmlns:local="using:Microsoft.PowerToys.Settings.UI.Helpers"
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:controls="using:Microsoft.PowerToys.Settings.UI.Controls"
@ -11,10 +12,10 @@
AutomationProperties.LandmarkType="Main"
mc:Ignorable="d">
<Page.Resources>
<local:NavigatablePage.Resources>
<converters:ZoomItInitialZoomConverter x:Key="ZoomItInitialZoomConverter" />
<converters:ZoomItTypeSpeedSliderConverter x:Key="ZoomItTypeSpeedSliderConverter" />
</Page.Resources>
</local:NavigatablePage.Resources>
<controls:SettingsPageControl
x:Uid="ZoomIt"
@ -313,4 +314,4 @@
<controls:PageLink Link="https://learn.microsoft.com/en-us/sysinternals/downloads/zoomit" Text="Sysinternals Zoomit by Mark Russinovich, Alex Mihaiuc, John Stephens" />
</controls:SettingsPageControl.SecondaryLinks>
</controls:SettingsPageControl>
</Page>
</local:NavigatablePage>

View File

@ -12,7 +12,7 @@ using Microsoft.UI.Xaml.Controls;
namespace Microsoft.PowerToys.Settings.UI.Views
{
public sealed partial class ZoomItPage : Page, IRefreshablePage
public sealed partial class ZoomItPage : NavigatablePage, IRefreshablePage
{
private ZoomItViewModel ViewModel { get; set; }