define function

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 WinJS version

WinJS 1.0

Namespace

WinJS.Binding

 

 

Show:
© 2017 Microsoft