[This documentation is preliminary and is subject to change.]
Applies to: Metro style apps only
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
- ActivatableAttribute(Windows.UI.Popups.IUICommandFactory, NTDDI_WIN8)
- ActivatableAttribute(NTDDI_WIN8)
- MarshalingBehaviorAttribute(Agile)
- ThreadingAttribute(Both)
- VersionAttribute(NTDDI_WIN8)
Members
The UICommand class has these types of members:
Constructors
The UICommand class has these constructors.
| Constructor | Description |
|---|---|
| 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.
| Property | Access type | Description |
|---|---|---|
| Read/write | Gets or sets the identifier of the command. | |
| Read/write | Gets or sets the handler for the event that is fired when the user selects the UICommand. | |
| Read/write | Gets 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 Release Preview |
|---|---|
|
Minimum supported server | Windows Server 2012 |
|
Namespace |
|
|
Metadata |
|
See also
- Adding context menus
- Context menu sample
- Guidelines and checklist for context menus
- Reference
- PopupMenu.Commands
Build date: 5/22/2012
