optimizeBindingReferences property

optimizeBindingReferences property

Applies to Windows and Windows Phone

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.


 WinJS.Binding.optimizeBindingReferences = true;

Property value

Type: Boolean

Set this property to true to avoid setting the ID of an element automatically.


This property should be set in the setup procedure of an app that uses WinJS binding. It is set in all Visual Studio project templates. You can find more examples of this usage in Quickstart: binding data and styles and How to use templates to bind data.

The code below shows how to add it to the beginning of the default.js file in a Visual Studio project for Windows apps using JavaScript


Minimum WinJS version

WinJS 1.0





© 2016 Microsoft