2025-09-26 12:46:09 -05:00
|
|
|
|
// 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 CommunityToolkit.Mvvm.Messaging;
|
2026-02-23 04:05:09 -08:00
|
|
|
|
using Microsoft.CmdPal.UI.ViewModels.Messages;
|
2025-09-26 12:46:09 -05:00
|
|
|
|
using Microsoft.CommandPalette.Extensions.Toolkit;
|
|
|
|
|
|
|
2026-02-23 04:05:09 -08:00
|
|
|
|
namespace Microsoft.CmdPal.UI.ViewModels.Commands;
|
2025-09-26 12:46:09 -05:00
|
|
|
|
|
|
|
|
|
|
public sealed partial class ShowDetailsCommand : InvokableCommand
|
|
|
|
|
|
{
|
|
|
|
|
|
public static string ShowDetailsCommandId { get; } = "com.microsoft.cmdpal.showDetails";
|
|
|
|
|
|
|
|
|
|
|
|
private static IconInfo IconInfo { get; } = new IconInfo("\uF000"); // KnowledgeArticle Icon
|
|
|
|
|
|
|
|
|
|
|
|
private DetailsViewModel Details { get; set; }
|
|
|
|
|
|
|
|
|
|
|
|
public ShowDetailsCommand(DetailsViewModel details)
|
|
|
|
|
|
{
|
|
|
|
|
|
Id = ShowDetailsCommandId;
|
2026-02-23 04:05:09 -08:00
|
|
|
|
Name = UI.ViewModels.Properties.Resources.ShowDetailsCommand;
|
2025-09-26 12:46:09 -05:00
|
|
|
|
Icon = IconInfo;
|
|
|
|
|
|
Details = details;
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
public override CommandResult Invoke()
|
|
|
|
|
|
{
|
|
|
|
|
|
// Send the ShowDetailsMessage when the action is invoked
|
|
|
|
|
|
WeakReferenceMessenger.Default.Send<ShowDetailsMessage>(new(Details));
|
|
|
|
|
|
return CommandResult.KeepOpen();
|
|
|
|
|
|
}
|
|
|
|
|
|
}
|