Windows Dev Center

UICommand class

Represents a command in a context menu.

Syntax


var uiCommand = new Windows.UI.Popups.UICommand(string, uiCommandInvokedHandler);
var uiCommand = new Windows.UI.Popups.UICommand(string, uiCommandInvokedHandler, object);
var uiCommand = new Windows.UI.Popups.UICommand();

Members

The UICommand class has these types of members:

Constructors

The UICommand class has these constructors.

ConstructorDescription
UICommand() Creates a new instance of the UICommand class.
UICommand(String) Creates a new instance of the UICommand class using the specified label.
UICommand(String, UICommandInvokedHandler) Creates a new instance of the UICommand class using the specified label and event handler.
UICommand(String, UICommandInvokedHandler, Object) Creates a new instance of the UICommand class using the specified label, event handler, and command identifier.

 

Methods

The UICommand class inherits methods from the Object class (C#/VB/C++).

Properties

The UICommand class has these properties.

PropertyAccess typeDescription

Id

Read/writeGets or sets the identifier of the command.

Invoked

Read/writeGets or sets the handler for the event that is fired when the user selects the UICommand.

Label

Read/writeGets or sets the label for the command.

 

Remarks

Use the PopupMenu.Commands property to add or modify the commands in a context menu.

Requirements (Windows 10 device family)

Device family

Universal

API contract

Windows.Foundation.UniversalApiContract, introduced version 1.0

Namespace

Windows.UI.Popups
Windows::UI::Popups [C++]

Metadata

Windows.Foundation.UniversalApiContract.winmd

Requirements (Windows 8.x and Windows Phone 8.x)

Minimum supported client

Windows 8 [Windows Store apps only]

Minimum supported server

Windows Server 2012 [Windows Store apps only]

Minimum supported phone

Windows Phone 8.1 [Windows Runtime apps only]

Namespace

Windows.UI.Popups
Windows::UI::Popups [C++]

Metadata

Windows.winmd

Attributes

[MarshalingBehavior(Agile)]
[Muse()]
[Threading(Both)]
[Version(0x06020000)]

See also

Object
IUICommand
Adding context menus
Context menu sample
Guidelines and checklist for context menus
Reference
PopupMenu.Commands

 

 

Show:
© 2015 Microsoft