WinJS.Binding.define function

Applies to Windows and Windows Phone

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

Syntax


var someFunction = WinJS.Binding.define(data);


Parameters

data

Type: object

The object to use as the pattern for defining the set of properties.

Return value

Type: function

A constructor function with 1 optional argument that is the initial state of the properties.

Examples

The following code shows how to use this method to create an observable class.


var PointClass = define({x:0,y:0});
var p1 = new PointClass();

Requirements

Minimum supported client

Windows 8 [Windows Store apps only]

Minimum supported server

Windows Server 2012 [Windows Store apps only]

Minimum supported phone

Windows Phone 8.1

Namespace

WinJS.Binding

Library

Base.js

 

 

Show:
© 2014 Microsoft