Applies to:
Defines a class using the given constructor and the specified instance members.
Syntax
var object = WinJS.Class.define(constructor, instanceMembers, staticMembers);
Parameters
-
constructor
-
Type:
Function A constructor function that is used to instantiate this type.
instanceMembers
-
Type:
Object The set of instance fields, properties, and methods made available on the type.
staticMembers
-
The set of static fields, properties, and methods made available on the type.
Return value
Type:The newly-defined type.
Remarks
For more information about using this method, see
Examples
The following code shows how to use this method.
var Robot = WinJS.Class.define( function(name) { this.name = name; }, { modelName: "" }, { harmsHumans: false }); var myRobot = new Robot("Mickey"); myRobot.modelName = "4500"; Robot.harmsHumans = false;