AppBarCommand.extraClass property

Applies to Windows and Windows Phone

Gets or sets additional Cascading Style Sheets (CSS) classes to apply to the element that hosts the AppBarCommand.

Syntax


<div data-win-control="WinJS.UI.AppBarCommand" data-win-options="{ extraClass : 'value'}" />


var extraClass = appBarCommand.extraClass;
appBarCommand.extraClass = extraClass;

Property value

Type: string

The name of the CSS class.

Examples

Here, we first add the extraClass property (with class name) to an AppBarCommand button in our HTML and then create a rule specifying the selector and AppBarCommand class in the corresponding CSS file.


<button data-win-control="WinJS.UI.AppBarCommand"
                data-win-options="{id:'cmdToggle',
                type:'toggle',
                label:'Toggle',
                icon:'audio',
                extraClass: 'customButtonFont'}"></button>



button.customButtonFont .win-commandimage {
    font-family: "Wingdings";
}

Requirements

Minimum supported client

Windows 8 [Windows Store apps only]

Minimum supported server

Windows Server 2012 [Windows Store apps only]

Minimum supported phone

Windows Phone 8.1

Namespace

WinJS.UI

Library

Ui.js

See also

AppBarCommand
AppBar
AppBarIcon
BackButton
NavBar
Your first app - Part 3: PageControl objects and navigation
Navigating between pages (HTML)
Adding app bars
Adding nav bars
HTML AppBar control sample
HTML NavBar control sample
Navigation and navigation history sample
Designers
Command patterns
Navigation patterns
Guidelines for app bars
Bottom app bar
Top app bar

 

 

Show:
© 2014 Microsoft