diff --git a/src/modules/cmdpal/Microsoft.CmdPal.UI/Controls/FallbackRankerDialog.xaml b/src/modules/cmdpal/Microsoft.CmdPal.UI/Controls/FallbackRankerDialog.xaml new file mode 100644 index 0000000000..dc454038ed --- /dev/null +++ b/src/modules/cmdpal/Microsoft.CmdPal.UI/Controls/FallbackRankerDialog.xaml @@ -0,0 +1,43 @@ + + + + + + + + 800 + + + + + + + + + + + + + diff --git a/src/modules/cmdpal/Microsoft.CmdPal.UI/Controls/FallbackRankerDialog.xaml.cs b/src/modules/cmdpal/Microsoft.CmdPal.UI/Controls/FallbackRankerDialog.xaml.cs new file mode 100644 index 0000000000..a5186609be --- /dev/null +++ b/src/modules/cmdpal/Microsoft.CmdPal.UI/Controls/FallbackRankerDialog.xaml.cs @@ -0,0 +1,33 @@ +// Copyright (c) Microsoft Corporation +// 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.Collections.Generic; +using System.IO; +using System.Linq; +using System.Runtime.InteropServices.WindowsRuntime; +using Microsoft.UI.Xaml; +using Microsoft.UI.Xaml.Controls; +using Microsoft.UI.Xaml.Controls.Primitives; +using Microsoft.UI.Xaml.Data; +using Microsoft.UI.Xaml.Input; +using Microsoft.UI.Xaml.Media; +using Microsoft.UI.Xaml.Navigation; +using Windows.Foundation; +using Windows.Foundation.Collections; + +namespace Microsoft.CmdPal.UI.Controls; + +public sealed partial class FallbackRankerDialog : UserControl +{ + public FallbackRankerDialog() + { + InitializeComponent(); + } + + public IAsyncOperation ShowAsync() + { + return FallbackRankerContentDialog!.ShowAsync()!; + } +} diff --git a/src/modules/cmdpal/Microsoft.CmdPal.UI/Microsoft.CmdPal.UI.csproj b/src/modules/cmdpal/Microsoft.CmdPal.UI/Microsoft.CmdPal.UI.csproj index 54961a5828..79ce3ff5ee 100644 --- a/src/modules/cmdpal/Microsoft.CmdPal.UI/Microsoft.CmdPal.UI.csproj +++ b/src/modules/cmdpal/Microsoft.CmdPal.UI/Microsoft.CmdPal.UI.csproj @@ -71,6 +71,7 @@ + @@ -231,6 +232,12 @@ + + + MSBuild:Compile + + + Designer diff --git a/src/modules/cmdpal/Microsoft.CmdPal.UI/Settings/ExtensionPage.xaml b/src/modules/cmdpal/Microsoft.CmdPal.UI/Settings/ExtensionPage.xaml index e01084bf51..0bab8d8d47 100644 --- a/src/modules/cmdpal/Microsoft.CmdPal.UI/Settings/ExtensionPage.xaml +++ b/src/modules/cmdpal/Microsoft.CmdPal.UI/Settings/ExtensionPage.xaml @@ -248,38 +248,6 @@ - - - - - - 800 - - - - - - - - - - - - + diff --git a/src/modules/cmdpal/Microsoft.CmdPal.UI/Settings/ExtensionsPage.xaml b/src/modules/cmdpal/Microsoft.CmdPal.UI/Settings/ExtensionsPage.xaml index 9e9600bd6e..af529a1bab 100644 --- a/src/modules/cmdpal/Microsoft.CmdPal.UI/Settings/ExtensionsPage.xaml +++ b/src/modules/cmdpal/Microsoft.CmdPal.UI/Settings/ExtensionsPage.xaml @@ -177,6 +177,12 @@ + + + + + + + diff --git a/src/modules/cmdpal/Microsoft.CmdPal.UI/Settings/ExtensionsPage.xaml.cs b/src/modules/cmdpal/Microsoft.CmdPal.UI/Settings/ExtensionsPage.xaml.cs index 360bce9f0b..f19be9f0cf 100644 --- a/src/modules/cmdpal/Microsoft.CmdPal.UI/Settings/ExtensionsPage.xaml.cs +++ b/src/modules/cmdpal/Microsoft.CmdPal.UI/Settings/ExtensionsPage.xaml.cs @@ -4,6 +4,7 @@ using CommunityToolkit.Mvvm.Messaging; using CommunityToolkit.WinUI.Controls; +using ManagedCommon; using Microsoft.CmdPal.UI.ViewModels; using Microsoft.CmdPal.UI.ViewModels.Services; using Microsoft.Extensions.DependencyInjection; @@ -45,4 +46,16 @@ public sealed partial class ExtensionsPage : Page SearchBox?.Focus(FocusState.Keyboard); args.Handled = true; } + + private async void MenuFlyoutItem_OnClick(object sender, RoutedEventArgs e) + { + try + { + await FallbackRankerDialog!.ShowAsync(); + } + catch (Exception ex) + { + Logger.LogError("Error when showing FallbackRankerDialog", ex); + } + } } diff --git a/src/modules/cmdpal/Microsoft.CmdPal.UI/Strings/en-us/Resources.resw b/src/modules/cmdpal/Microsoft.CmdPal.UI/Strings/en-us/Resources.resw index 82d8d56699..5de0447d35 100644 --- a/src/modules/cmdpal/Microsoft.CmdPal.UI/Strings/en-us/Resources.resw +++ b/src/modules/cmdpal/Microsoft.CmdPal.UI/Strings/en-us/Resources.resw @@ -1,17 +1,17 @@  - @@ -721,4 +721,7 @@ Right-click to remove the key combination, thereby deactivating the shortcut. Drag items to set which fallback commands run first; commands at the top take priority. + + Manage fallback order + \ No newline at end of file