diff --git a/src/modules/cmdpal/Microsoft.CmdPal.UI.ViewModels/CommandItemViewModel.cs b/src/modules/cmdpal/Microsoft.CmdPal.UI.ViewModels/CommandItemViewModel.cs index 24dd9e1788c2..e8e20974de35 100644 --- a/src/modules/cmdpal/Microsoft.CmdPal.UI.ViewModels/CommandItemViewModel.cs +++ b/src/modules/cmdpal/Microsoft.CmdPal.UI.ViewModels/CommandItemViewModel.cs @@ -190,7 +190,7 @@ public void SlowInitializeProperties() contextItem.SlowInitializeProperties(); }); - if (!string.IsNullOrEmpty(model.Command.Name)) + if (!string.IsNullOrEmpty(model.Command?.Name)) { _defaultCommandContextItem = new(new CommandContextItem(model.Command!), PageContext) { diff --git a/src/modules/cmdpal/ext/Microsoft.CmdPal.Ext.System/FallbackSystemCommandItem.cs b/src/modules/cmdpal/ext/Microsoft.CmdPal.Ext.System/FallbackSystemCommandItem.cs index 94b23e3e0d64..6dfe81af1b46 100644 --- a/src/modules/cmdpal/ext/Microsoft.CmdPal.Ext.System/FallbackSystemCommandItem.cs +++ b/src/modules/cmdpal/ext/Microsoft.CmdPal.Ext.System/FallbackSystemCommandItem.cs @@ -32,6 +32,7 @@ public override void UpdateQuery(string query) { if (string.IsNullOrWhiteSpace(query)) { + Command = null; Title = string.Empty; Subtitle = string.Empty; return; @@ -58,6 +59,7 @@ public override void UpdateQuery(string query) if (result == null) { + Command = null; Title = string.Empty; Subtitle = string.Empty; diff --git a/src/modules/cmdpal/ext/Microsoft.CmdPal.Ext.System/Pages/SystemCommandPage.cs b/src/modules/cmdpal/ext/Microsoft.CmdPal.Ext.System/Pages/SystemCommandPage.cs index 7bfd7bb4e4a3..3d02cdf18f55 100644 --- a/src/modules/cmdpal/ext/Microsoft.CmdPal.Ext.System/Pages/SystemCommandPage.cs +++ b/src/modules/cmdpal/ext/Microsoft.CmdPal.Ext.System/Pages/SystemCommandPage.cs @@ -10,12 +10,12 @@ namespace Microsoft.CmdPal.Ext.System.Pages; public sealed partial class SystemCommandPage : ListPage { - private SettingsManager _settingsManager; + private readonly SettingsManager _settingsManager; public SystemCommandPage(SettingsManager settingsManager) { - Title = Resources.Microsoft_plugin_ext_system_page_name; - Name = Resources.Microsoft_plugin_ext_system_page_name; + Title = Resources.Microsoft_plugin_ext_system_page_title; + Name = Resources.Microsoft_plugin_command_name_open; Icon = IconHelpers.FromRelativePath("Assets\\SystemCommand.svg"); _settingsManager = settingsManager; ShowDetails = true; diff --git a/src/modules/cmdpal/ext/Microsoft.CmdPal.Ext.System/Properties/Resources.Designer.cs b/src/modules/cmdpal/ext/Microsoft.CmdPal.Ext.System/Properties/Resources.Designer.cs index 1574a2aa0d02..1cfa1a6353b0 100644 --- a/src/modules/cmdpal/ext/Microsoft.CmdPal.Ext.System/Properties/Resources.Designer.cs +++ b/src/modules/cmdpal/ext/Microsoft.CmdPal.Ext.System/Properties/Resources.Designer.cs @@ -205,7 +205,7 @@ public static string Microsoft_plugin_ext_settings_hideDisconnectedNetworkInfo { } /// - /// Looks up a localized string similar to Windows System Command. + /// Looks up a localized string similar to System Commands. /// public static string Microsoft_plugin_ext_system_page_name { get { @@ -213,6 +213,15 @@ public static string Microsoft_plugin_ext_system_page_name { } } + /// + /// Looks up a localized string similar to Windows System Commands. + /// + public static string Microsoft_plugin_ext_system_page_title { + get { + return ResourceManager.GetString("Microsoft_plugin_ext_system_page_title", resourceCulture); + } + } + /// /// Looks up a localized string similar to Adapter name. /// diff --git a/src/modules/cmdpal/ext/Microsoft.CmdPal.Ext.System/Properties/Resources.resx b/src/modules/cmdpal/ext/Microsoft.CmdPal.Ext.System/Properties/Resources.resx index 0aaa3d0611d7..23d27a86a2bb 100644 --- a/src/modules/cmdpal/ext/Microsoft.CmdPal.Ext.System/Properties/Resources.resx +++ b/src/modules/cmdpal/ext/Microsoft.CmdPal.Ext.System/Properties/Resources.resx @@ -160,8 +160,11 @@ Hide disconnected network info + + Windows System Commands + - Windows System Command + System Commands Adapter name diff --git a/src/modules/cmdpal/ext/Microsoft.CmdPal.Ext.System/SystemCommandExtensionProvider.cs b/src/modules/cmdpal/ext/Microsoft.CmdPal.Ext.System/SystemCommandExtensionProvider.cs index b1dc3ffc26f6..54ec578dfac3 100644 --- a/src/modules/cmdpal/ext/Microsoft.CmdPal.Ext.System/SystemCommandExtensionProvider.cs +++ b/src/modules/cmdpal/ext/Microsoft.CmdPal.Ext.System/SystemCommandExtensionProvider.cs @@ -14,7 +14,7 @@ public partial class SystemCommandExtensionProvider : CommandProvider private readonly ICommandItem[] _commands; private static readonly SettingsManager _settingsManager = new(); public static readonly SystemCommandPage Page = new(_settingsManager); - private readonly FallbackSystemCommandItem _fallbackFileItem = new(_settingsManager); + private readonly FallbackSystemCommandItem _fallbackSystemItem = new(_settingsManager); public SystemCommandExtensionProvider() { @@ -23,7 +23,7 @@ public SystemCommandExtensionProvider() _commands = [ new CommandItem(Page) { - Title = Resources.Microsoft_plugin_ext_system_page_name, + Title = Resources.Microsoft_plugin_ext_system_page_title, Icon = Page.Icon, MoreCommands = [new CommandContextItem(_settingsManager.Settings.SettingsPage)], }, @@ -38,5 +38,5 @@ public override ICommandItem[] TopLevelCommands() return _commands; } - public override IFallbackCommandItem[] FallbackCommands() => [_fallbackFileItem]; + public override IFallbackCommandItem[] FallbackCommands() => [_fallbackSystemItem]; }