Compartilhar via


UICommand Classe

Definição

Representa um comando em um menu de contexto.

public ref class UICommand sealed : IUICommand
/// [Windows.Foundation.Metadata.Activatable(65536, Windows.Foundation.UniversalApiContract)]
/// [Windows.Foundation.Metadata.Activatable(Windows.UI.Popups.IUICommandFactory, 65536, Windows.Foundation.UniversalApiContract)]
/// [Windows.Foundation.Metadata.ContractVersion(Windows.Foundation.UniversalApiContract, 65536)]
/// [Windows.Foundation.Metadata.MarshalingBehavior(Windows.Foundation.Metadata.MarshalingType.Agile)]
/// [Windows.Foundation.Metadata.Threading(Windows.Foundation.Metadata.ThreadingModel.Both)]
class UICommand final : IUICommand
/// [Windows.Foundation.Metadata.ContractVersion(Windows.Foundation.UniversalApiContract, 65536)]
/// [Windows.Foundation.Metadata.MarshalingBehavior(Windows.Foundation.Metadata.MarshalingType.Agile)]
/// [Windows.Foundation.Metadata.Threading(Windows.Foundation.Metadata.ThreadingModel.Both)]
/// [Windows.Foundation.Metadata.Activatable(Windows.UI.Popups.IUICommandFactory, 65536, "Windows.Foundation.UniversalApiContract")]
/// [Windows.Foundation.Metadata.Activatable(65536, "Windows.Foundation.UniversalApiContract")]
class UICommand final : IUICommand
[Windows.Foundation.Metadata.Activatable(65536, typeof(Windows.Foundation.UniversalApiContract))]
[Windows.Foundation.Metadata.Activatable(typeof(Windows.UI.Popups.IUICommandFactory), 65536, typeof(Windows.Foundation.UniversalApiContract))]
[Windows.Foundation.Metadata.ContractVersion(typeof(Windows.Foundation.UniversalApiContract), 65536)]
[Windows.Foundation.Metadata.MarshalingBehavior(Windows.Foundation.Metadata.MarshalingType.Agile)]
[Windows.Foundation.Metadata.Threading(Windows.Foundation.Metadata.ThreadingModel.Both)]
public sealed class UICommand : IUICommand
[Windows.Foundation.Metadata.ContractVersion(typeof(Windows.Foundation.UniversalApiContract), 65536)]
[Windows.Foundation.Metadata.MarshalingBehavior(Windows.Foundation.Metadata.MarshalingType.Agile)]
[Windows.Foundation.Metadata.Threading(Windows.Foundation.Metadata.ThreadingModel.Both)]
[Windows.Foundation.Metadata.Activatable(typeof(Windows.UI.Popups.IUICommandFactory), 65536, "Windows.Foundation.UniversalApiContract")]
[Windows.Foundation.Metadata.Activatable(65536, "Windows.Foundation.UniversalApiContract")]
public sealed class UICommand : IUICommand
function UICommand(label, action, commandId)
Public NotInheritable Class UICommand
Implements IUICommand
Herança
Object Platform::Object IInspectable UICommand
Atributos
Implementações

Requisitos do Windows

Família de dispositivos
Windows 10 (introduzida na 10.0.10240.0)
API contract
Windows.Foundation.UniversalApiContract (introduzida na v1.0)

Comentários

Use a propriedade PopupMenu.Commands para adicionar ou modificar os comandos em um menu de contexto.

Construtores

UICommand()

Cria uma nova instância da classe UICommand .

UICommand(String)

Cria uma nova instância da classe UICommand usando o rótulo especificado.

UICommand(String, UICommandInvokedHandler)

Cria uma nova instância da classe UICommand usando o rótulo e o manipulador de eventos especificados.

UICommand(String, UICommandInvokedHandler, Object)

Cria uma nova instância da classe UICommand usando o rótulo, o manipulador de eventos e o identificador de comando especificados.

Propriedades

Id

Obtém ou define o identificador do comando .

Invoked

Obtém ou define o manipulador para o evento que é acionado quando o usuário seleciona o UICommand.

Label

Obtém ou define o rótulo para o comando .

Aplica-se a

Confira também