EN
Dieser Inhalt ist in Ihrer Sprache leider nicht verfügbar. Im Folgenden finden Sie die englische Version.

WinJS.UI.Hub object

Applies to Windows only

Creates a hub navigation pattern consisting of sections that can be navigated to. Each section is defined by a HubSection object.

Explore this functionality in more depth as part of our App features, start to finish series:  Hierarchical navigation, start to finish (HTML)

Syntax


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


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

Members

The Hub object has these types of members:

Constructors

The Hub object has these constructors.

ConstructorDescription
Hub

Creates a new Hub control.

 

Events

The Hub object has these events.

EventDescription
oncontentanimating

Raised when the Hub is about to play entrance, content transition, insert, or remove animations.

onheaderinvoked

Raised when the user clicks on an interactive header.

onloadingstatechanged

Raised when the Hub control's loadingState changes.

 

Methods

The Hub object has these methods.

MethodDescription
addEventListener

Registers an event handler for the specified event.

dispatchEvent

Raises an event of the specified type and with additional properties.

dispose

Releases resources held by this Hub. Call this method when the Hub is no longer needed. After calling this method, the Hub becomes unusable.

removeEventListener

Removes an event handler that the addEventListener method registered.

 

Properties

The Hub object has these properties.

PropertyAccess typeDescription

element

Read-only

Gets the DOM element that hosts the Hub control.

headerTemplate

Read/write

Gets or sets the Template or templating function that creates the DOM elements for each HubSection header. Your HubSection object should provide strings for HubSection.header property.

indexOfFirstVisible

Read/write

Gets or sets the index of the first HubSection at least partially in view. This property is useful for animating the visible content in the Hub.

indexOfLastVisible

Read/write

Gets or sets the index of last HubSection at least partially in view. Used for animating the visible content in the Hub.

loadingState

Read-only

Gets a value that indicates whether the hub is still loading or whether loading is complete. The value changes to complete after all the sections and content inside them has loaded.

orientation

Read/write

Gets or sets the orientation of sections within the Hub.

scrollPosition

Read/write

Gets or sets the distance between the start of the Hub and the current viewable area.

sectionOnScreen

Read/write

Gets or sets the index of the first visible HubSection.

sections

Read/write

Gets or sets the List that contains the HubSection objects that belong to this Hub.

zoomableView

Read-only

This API supports the SemanticZoom infrastructure and is not intended to be used directly from your code.

 

Requirements

Minimum supported client

Windows 8.1 [Windows Store apps only]

Minimum supported server

Windows Server 2012 R2 [Windows Store apps only]

Minimum supported phone

None supported

Namespace

WinJS.UI

Library

Ui.js

See also

WinJS.UI Namespace
HubSection
AppBar
NavBar
BackButton
Your first app - Part 3: PageControl objects and navigation
Quickstart: Using a hub control for layout and navigation
Navigating between pages (HTML)
Adding app bars
Adding nav bars
HTML Hub control sample
HTML AppBar control sample
HTML NavBar control sample
Navigation and navigation history sample
Designers
Command patterns
Navigation patterns
Hub
Guidelines for the hub control

 

 

Anzeigen:
© 2014 Microsoft