diff --git a/src/modules/cmdpal/Exts/Microsoft.CmdPal.Ext.TimeDate/Helpers/SettingsManager.cs b/src/modules/cmdpal/Exts/Microsoft.CmdPal.Ext.TimeDate/Helpers/SettingsManager.cs index 07750ebfc0..d0de0017b8 100644 --- a/src/modules/cmdpal/Exts/Microsoft.CmdPal.Ext.TimeDate/Helpers/SettingsManager.cs +++ b/src/modules/cmdpal/Exts/Microsoft.CmdPal.Ext.TimeDate/Helpers/SettingsManager.cs @@ -164,5 +164,7 @@ public class SettingsManager : JsonSettingsManager // Load settings from file upon initialization LoadSettings(); + + Settings.SettingsChanged += (s, a) => this.SaveSettings(); } } diff --git a/src/modules/cmdpal/Exts/Microsoft.CmdPal.Ext.TimeDate/Pages/TimeDateExtensionPage.cs b/src/modules/cmdpal/Exts/Microsoft.CmdPal.Ext.TimeDate/Pages/TimeDateExtensionPage.cs index 6f9b804690..bb5b58adb6 100644 --- a/src/modules/cmdpal/Exts/Microsoft.CmdPal.Ext.TimeDate/Pages/TimeDateExtensionPage.cs +++ b/src/modules/cmdpal/Exts/Microsoft.CmdPal.Ext.TimeDate/Pages/TimeDateExtensionPage.cs @@ -16,7 +16,7 @@ internal sealed partial class TimeDateExtensionPage : DynamicListPage public TimeDateExtensionPage(SettingsManager settingsManager) { - Icon = new("\uEC92"); // DateTime icon + Icon = IconHelpers.FromRelativePath("Assets\\TimeDate.svg"); Title = Resources.Microsoft_plugin_timedate_main_page_title; Name = Resources.Microsoft_plugin_timedate_main_page_name; PlaceholderText = Resources.Microsoft_plugin_timedate_placeholder_text; diff --git a/src/modules/cmdpal/Exts/Microsoft.CmdPal.Ext.TimeDate/TimeDateCommandsProvider.cs b/src/modules/cmdpal/Exts/Microsoft.CmdPal.Ext.TimeDate/TimeDateCommandsProvider.cs index 76f30b6f8a..a76cdb9ee0 100644 --- a/src/modules/cmdpal/Exts/Microsoft.CmdPal.Ext.TimeDate/TimeDateCommandsProvider.cs +++ b/src/modules/cmdpal/Exts/Microsoft.CmdPal.Ext.TimeDate/TimeDateCommandsProvider.cs @@ -15,20 +15,23 @@ namespace Microsoft.CmdPal.Ext.TimeDate; public partial class TimeDateCommandsProvider : CommandProvider { private readonly CommandItem _command; - private readonly SettingsManager _settingsManager = new(); + private static readonly SettingsManager _settingsManager = new(); private static readonly CompositeFormat MicrosoftPluginTimedatePluginDescription = System.Text.CompositeFormat.Parse(Resources.Microsoft_plugin_timedate_plugin_description); + private static readonly TimeDateExtensionPage _timeDateExtensionPage = new(_settingsManager); public TimeDateCommandsProvider() { DisplayName = Resources.Microsoft_plugin_timedate_plugin_name; - _command = new CommandItem(new TimeDateExtensionPage(_settingsManager)) + _command = new CommandItem(_timeDateExtensionPage) { - Icon = IconHelpers.FromRelativePath("Assets\\TimeDate.svg"), + Icon = _timeDateExtensionPage.Icon, Title = Resources.Microsoft_plugin_timedate_plugin_name, Subtitle = GetTranslatedPluginDescription(), MoreCommands = [new CommandContextItem(_settingsManager.Settings.SettingsPage)], }; + + Icon = _timeDateExtensionPage.Icon; } private string GetTranslatedPluginDescription() diff --git a/src/modules/cmdpal/Exts/Microsoft.CmdPal.Ext.TimeDate/app.manifest b/src/modules/cmdpal/Exts/Microsoft.CmdPal.Ext.TimeDate/app.manifest deleted file mode 100644 index bcafb9bc5b..0000000000 --- a/src/modules/cmdpal/Exts/Microsoft.CmdPal.Ext.TimeDate/app.manifest +++ /dev/null @@ -1,19 +0,0 @@ - - - - - - - - - - - - - - PerMonitorV2 - - -