UICommand class

Expand
This topic has not yet been rated - Rate this topic

UICommand class

[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.

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 Release Preview

Minimum supported server

Windows Server 2012

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

 

 

Build date: 5/22/2012

Did you find this helpful?
(1500 characters remaining)
Community Additions ADD