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

WinJS.UI.AppBarCommand object

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

Applies to: Metro style apps only

Represents a command to be displayed in an app bar.

Syntax


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


var object = new WinJS.UI.AppBarCommand(element, options);

Members

The AppBarCommand object has these types of members:

Methods

The AppBarCommand object has these methods.

MethodDescription
addEventListener

Registers an event handler for the specified event.

AppBarCommand

Creates a new AppBarCommand object.

removeEventListener

Removes an event handler that the addEventListener method registered.

 

Properties

The AppBarCommand object has these properties.

PropertyDescription

disabled

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

element

Gets the DOM element that hosts the AppBarCommand.

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 AppBarCommand's button is invoked.

hidden

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

icon

Gets or sets the icon of the AppBarCommand.

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.

section

Gets the section of the app bar that the command is in.

selected

Gets or sets the selected state of a toggle button.

tooltip

Gets or sets the tooltip of the command.

type

Gets the type of the command.

 

Remarks

Styling the AppBarCommand

CSS classes

To customize the AppBarCommand, 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 AppBarCommand.

win-commandicon

Styles the icon box for the AppBarCommand.

win-commandimage

Styles the image for the AppBarCommand.

win-commandring

Styles the icon ring for the AppBarCommand.

win-label

Styles the label for the AppBarCommand.

 

Note  There are several CSS classes that are shared between multiple Windows Library for JavaScript controls. To limit your custom styles to a specific control, assign the control an ID or custom class name and use that as part of your style selector.

Requirements

Minimum supported client

Windows 8 Consumer Preview

Minimum supported server

Windows Server 8 Beta

Namespace

WinJS.UI

Library

Ui.js

See also

AppBar

 

 

Build date: 2/10/2012

Ajouts de la communauté

AJOUTER
Afficher:
© 2016 Microsoft