WinJS.Binding Namespace

1 out of 6 rated this helpful - Rate this topic

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

ObjectDescription

dynamicObservableMixin object

Allows you to add bindable properties dynamically.

FilteredListProjection object

Do not instantiate. A list returned by the createFiltered method.

GroupsListProjection object

Do not instantiate. A list of groups.

GroupedSortedListProjection object

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.

List object

Creates a WinJS.Binding.List object.

mixin 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.

observableMixin object

Provides functions that can make an object observable.

SortedListProjection object

Do not instantiate. Returned by the createSorted method.

Template object

Provides a reusable declarative binding element.

 

Properties

PropertyDescription

optimizeBindingReferences property

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

FunctionDescription

addProperty function

Adds a property with change notification to this object, including a ECMAScript5 property definition.

as function

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.

bind function

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.

converter function

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.

defaultBind function

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.

define function

Creates a new constructor function that supports observability with the specified set of properties.

expandProperties function

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.

getProperty function

Gets a property value by name.

initializer function

Marks a custom initializer function as being compatible with declarative data binding.

notify function

Notifies listeners that a property value was updated.

oneTime function

Sets the destination property to the value of the source property.

processAll function

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.

removeProperty function

Removes a property value.

setAttribute function

Creates a one-way binding between the source object and an attribute on the destination element.

setAttributeOneTime function

Sets an attribute on the destination element to the value of the source property.

setProperty function

Updates a property value and notifies any listeners.

unbind function

Removes one or more listeners from the notification list for a given property.

unwrap function

Returns the original (non-observable) object is returned if the specified object is an observable proxy,

updateProperty function

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

Did you find this helpful?
(1500 characters remaining)
© 2013 Microsoft. All rights reserved.