MenuCommand object
TOC
Réduire la table des matières
Développer la table des matières

WinJS.UI.MenuCommand object

[This documentation is preliminary and is subject to change.]

Applies to: Metro style apps only

Represents a command to be displayed in a Menu object.

Syntax


<button data-win-control="WinJS.UI.MenuCommand" />


var object = new WinJS.UI.MenuCommand();

Members

The MenuCommand object has these types of members:

Methods

The MenuCommand object has these methods.

MethodDescription
addEventListener

Registers an event handler for the specified event.

MenuCommand

Creates a new MenuCommand object.

removeEventListener

Removes an event handler that the addEventListener method registered.

 

Properties

The MenuCommand object has these properties.

PropertyDescription

disabled

Gets or sets a value that indicates whether the MenuCommand is disabled.

element

Gets the DOM element that hosts the MenuCommand.

extraClass

Adds an extra CSS class during construction.

flyout

Gets or sets the Flyout object displayed by this command. The specified flyout is shown when the MenuCommand's button is invoked.

hidden

Gets a value that indicates whether the MenuCommand is hidden or in the process of becoming hidden.

id

Gets the element identifier (ID) of the command.

label

Gets or sets the label of the command.

onclick

Gets or sets the function to be invoked when the command is clicked.

selected

Gets or sets the selected state of a toggle button.

type

Gets the type of the command.

 

Remarks

Styling the MenuCommand

CSS classes

To customize a MenuCommand, you can define your own styles for these CSS classes (defined by the Windows Library for JavaScript style sheets):

CSS classDescription

win-command

Styles the entire MenuCommand control.

 

Requirements

Namespace

WinJS.UI

Library

 

 

Build date: 2/10/2012

Ajouts de la communauté

AJOUTER
Afficher:
© 2018 Microsoft