OpenSettingsCommand.cs
1 // Copyright (c) Microsoft Corporation 2 // The Microsoft Corporation licenses this file to you under the MIT license. 3 // See the LICENSE file in the project root for more information. 4 5 using CommunityToolkit.Mvvm.Messaging; 6 using Microsoft.CmdPal.UI.Messages; 7 using Microsoft.CommandPalette.Extensions; 8 using Microsoft.CommandPalette.Extensions.Toolkit; 9 10 namespace Microsoft.CmdPal.UI.ViewModels.BuiltinCommands; 11 12 public partial class OpenSettingsCommand : InvokableCommand 13 { 14 public OpenSettingsCommand() 15 { 16 Name = Properties.Resources.builtin_open_settings_name; 17 Icon = new IconInfo("\uE713"); 18 } 19 20 public override ICommandResult Invoke() 21 { 22 WeakReferenceMessenger.Default.Send(new OpenSettingsMessage()); 23 return CommandResult.KeepOpen(); 24 } 25 }