WinJS.Binding.declarativeBind function

Applies to: Windows Store apps only

Binds values from the specified data context to elements that are descendants of the specified root element and have declarative binding attributes (data-win-bind and data-win-bindsource).

Warning  Do not attempt to bind data to the ID of an HTML element.

Syntax

WinJS.Binding.declarativeBind(dataContext, rootElement, skipRoot, bindingCache).done( /* Your success and error handlers */ );

Parameters

dataContext

Type: Object

The object to use for default data binding. Each element (or one of its children) may contain a data-win-bindsource attribute that overrides the dataContext.

rootElement

Type: DOMElement

The element at which to start traversing to find elements to bind to. If this parameter is omitted, the entire document is searched.

skipRoot

Type: Boolean

If true, the elements to be bound skip the specified root element and include only the children.

bindingCache

Type: Object

The cached binding data.

Return value

Type: Promise

A promise that completes when each item that contains binding declarations has been processed and the update has started.

Remarks

For more information about using declarative binding, see the topic Quickstart: binding data and styles to HTML elements and the Declarative Binding sample at Windows Store app samples.

Requirements

Namespace

WinJS.Binding

Library

Base.js

 

 

Build date: 9/6/2012

Community Additions

Show:
© 2014 Microsoft