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

WinJS.UI.AppBar object

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

Applies to: Metro style apps only

Represents an application toolbar for displaying commands.

Syntax


<div data-win-control="WinJS.UI.AppBar"></div>


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

Members

The AppBar object has these types of members:

Events

The AppBar object has these events.

EventDescription
afterhide

Occurs immediately after the AppBar is hidden.

aftershow

Occurs after the AppBar is shown.

beforehide

Occurs before the AppBar is hidden

beforeshow

Occurs before a hidden AppBar is shown.

 

Methods

The AppBar object has these methods.

MethodDescription
addEventListener Method

Registers an event handler for the specified event.

AppBar

Creates a new AppBar object.

getCommandById

Returns the AppBarCommand object identified by id.

hide Method

Hides the AppBar.

hideCommands

Hides the specified commands of the AppBar.

removeEventListener Method

Removes an event handler that the addEventListener method registered.

show Method

Shows the AppBar if it is not disabled.

showCommands

Shows the specified commands of the AppBar.

showOnlyCommands

Shows the specified commands of the AppBar while hiding all other commands.

 

Properties

The AppBar object has these properties.

PropertyDescription

commands

Sets the AppBarCommand objects that appear in the app bar.

disabled

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

element Property

Gets the DOM element that hosts the AppBar.

hidden Property

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

layout

Gets or sets the layout of the app bar contents.

placement

Gets or sets a value that specifies whether the AppBar appears at the top or bottom of the main view.

sticky

Gets or sets a value that indicates whether the AppBar is sticky (won't light dismiss). If not sticky, the app bar dismisses normally when the user touches outside of the appbar.

 

Remarks

Styling the AppBar

CSS classes

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

CSS classDescription

win-appbar

Styles an AppBar that uses a custom layout.

win-command

Styles commands within the AppBar.

win-commandicon

Styles the icon box for AppBar commands.

win-commandimage

Styles the images for AppBar commands.

win-commandlayout

Styles an AppBar that uses the standard layout.

win-commandring

Styles the icon rings for AppBar commands.

win-label

Styles labels for AppBar commands.

 

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

 

 

Build date: 2/10/2012

Ajouts de la communauté

AJOUTER
Afficher:
© 2017 Microsoft