Provides functionality for data and template binding.
For more information about binding, see the topics Quickstart: binding data and styles to HTML elements and How to bind a complex object, as well as the Declarative Binding and Programmatic Binding samples at Windows Store app samples.
The WinJS.Binding namespace has these types of members:
Objects
| Object | Description |
|---|---|
|
Allows you to add bindable properties dynamically. | |
|
Do not instantiate. A list returned by the createFiltered method. | |
|
Do not instantiate. A list of groups. | |
|
Do not instantiate. Sorts the underlying list by group key and within a group respects the position of the item in the underlying list. Returned by createGrouped. | |
|
Creates a WinJS.Binding.List object. | |
|
Provides a standard implementation of the bindable contract, as well as a basic storage mechanism that participates in change notification and an asynchronous notification implementation. | |
|
Provides functions that can make an object observable. | |
|
Do not instantiate. Returned by the createSorted method. | |
|
Provides a reusable declarative binding element. |
Properties
| Property | Description |
|---|---|
|
Determines whether or not binding should automatically set the ID of an element. This property should be set to true in apps that use Windows Library for JavaScript (WinJS) binding. |
Functions
| Function | Description |
|---|---|
|
Adds a property with change notification to this object, including a ECMAScript5 property definition. | |
|
Returns an observable object. This may be an observable proxy for the specified object, an existing proxy, or the specified object itself if it directly supports observation. | |
|
Links the specified action to the property specified in the name parameter. This function is invoked when the value of the property may have changed. It is not guaranteed that the action will be called only when a value has actually changed, nor is it guaranteed that the action will be called for every value change. The implementation of this function coalesces change notifications, such that multiple updates to a property value may result in only a single call to the specified action. Warning Do not attempt to bind data to the ID of an HTML element. | |
|
Creates a default binding initializer for binding between a source property and a destination property with the specified converter function that is executed on the value of the source property. | |
|
Creates a one-way binding between the source object and the destination object. Warning Do not attempt to bind data to the ID of an HTML element. | |
|
Creates a new constructor function that supports observability with the specified set of properties. | |
|
Wraps the specified object so that all its properties are instrumented for binding. This is meant to be used in conjunction with the binding mixin. | |
|
Gets a property value by name. | |
|
Marks a custom initializer function as being compatible with declarative data binding. | |
|
Notifies listeners that a property value was updated. | |
|
Sets the destination property to the value of the source property. | |
|
Binds the values of an object to the values of a DOM element that has the data-win-bind attribute. If multiple DOM elements are to be bound, you must set the attribute on all of them. YSee the example below for details. | |
|
Removes a property value. | |
|
Creates a one-way binding between the source object and an attribute on the destination element. | |
|
Sets an attribute on the destination element to the value of the source property. | |
|
Updates a property value and notifies any listeners. | |
|
Removes one or more listeners from the notification list for a given property. | |
|
Returns the original (non-observable) object is returned if the specified object is an observable proxy, | |
|
Updates a property value and notifies any listeners. |
Requirements
|
Minimum supported client | Windows 8 [Windows Store apps only] |
|---|---|
|
Minimum supported server | Windows Server 2012 [Windows Store apps only] |
Build date: 12/5/2012