ToastCommand.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 Microsoft.CommandPalette.Extensions; 6 using Microsoft.CommandPalette.Extensions.Toolkit; 7 8 namespace SamplePagesExtension; 9 10 internal sealed partial class ToastCommand(string message, MessageState state = MessageState.Info) : InvokableCommand 11 { 12 public override ICommandResult Invoke() 13 { 14 var t = new ToastStatusMessage(new StatusMessage() 15 { 16 Message = message, 17 State = state, 18 }); 19 t.Show(); 20 21 return CommandResult.KeepOpen(); 22 } 23 }