Adding a WinJS control in JavaScript code in Windows 10 App

Published on August 23, 2015 by abundantcode

Filed under Universal Windows App

Last modified August 23, 2015

Print this page

rate 1 star rate 2 star rate 3 star rate 4 star rate 5 star
Your rating: none, Average: 0 (0 votes)

This article have been viewed 1990 times

You can add the WinJS control to the page in the markup page or from your javascript code.

How to add a WinJS control in your JavaScript code for Windows 10 Apps ?

Add the element in the markup (HTML page) that will host your control.

<div id="element"></div>

In your JavaScript code , retreive the element using the document.getElementById method.

var containerElement = document.getElementById("element");

You can now start creating the control (for example : Rating Control) by passing the containerElement to the constructor.

var ratingControl = new WinJS.UI.Rating(containerElement ); 

When you run the Windows 10 app and view the page , you should see the RatingControl displayed in the screen.

If you enjoyed this post, please consider leaving a comment or subscribing to the RSS feed to have future articles delivered to your feed reader.

Leave a Comment


You might be Interested in these Posts

ES6: The future is now at Warrington on October 18 , 2016

JavaScript North West User Group is hosting its user group meet on the topic "ES6: The future i...

How to delete user account from command line in Windows 10 ?

You can delete a user account from command line in Windows 10 using the net user command and specify...

How to add new user account from command line in Windows 10 ?

You can add a new user account in Windows 10 using command prompt using the net user command and pas...