Information
The topic you requested is included in another documentation set. For convenience, it's displayed below. Choose Switch to see the topic in its original location.

UICommand class

Applies to Windows and Windows Phone

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();

Attributes

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

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

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

See also

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

 

 

Show:
© 2014 Microsoft