0 out of 2 rated this helpful - Rate this topic

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

Attributes

ActivatableAttribute(Windows.UI.Popups.IUICommandFactory, NTDDI_WIN8)
ActivatableAttribute(NTDDI_WIN8)
MarshalingBehaviorAttribute(Agile)
MuseAttribute()
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 [Windows Store apps only]

Minimum supported server

Windows Server 2012 [Windows Store 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

 

 

Build date: 2/25/2013

© 2013 Microsoft. All rights reserved.