Download presentation
Presentation is loading. Please wait.
Published byAlfred Willet Modified over 9 years ago
8
WinJS Priorities max: 15 high: 13 aboveNormal: 9 normal: 0 belowNormal: -9 idle: -13 min: -15
9
WinJS Scheduler – Code Example var S = WinJS.Utilities.Scheduler; // Example of a scheduling work at normal priority S.schedule(function () { // Scheduled code to execute }, S.Priority.normal); // Example of scheduling a data request at high priority S.schedule(function () { // Scheduled code to execute }, S.Priority.high, this, "Work item description");
14
Controls: Implementing Dispose var MyControl = WinJS.Class.define(function (element, options) { this.element = element; element.winControl = this; // Add win-disposable class to element WinJS.Utilities.addClass(this.element, "win-disposable"); this._disposed = false; }, { dispose: function () {//... } });
15
Controls: Implementing Dispose dispose: function () { if (this._disposed) { return; } this._disposed = true; // Call dispose on all children WinJS.Utilities.disposeSubTree(this.element); // Disconnect click handlers, resources, connections, etc. if (this._button && this._clickHandler) { this._button.removeEventListener("click", this._clickHandler, false); }
16
Apps: Calling Dispose // Responds to navigation by adding new pages to the DOM. _navigating: function (args) { // Dispose all controls in the view WinJS.Utilities.disposeSubTree(this._element); // Remove old content from the view this._element.removeChild(oldElement); oldElement.innerText = ""; // Add new content to the view this._element.appendChild(newElement); }
32
Loading and parsing of HTML, JS, CSS New host process Tile click Windows Runtime "activated" event Splash screen Ready for user Navigation App visible WinJS.UI.proces sAll App initialization Splash screen cross fade Get data Populate ListView Animate content App read to use
34
Splash screenApp visibleApp ready to use
35
Splash screen App visible App ready to use
37
Splash screen App visibleApp ready to use
Similar presentations
© 2025 SlidePlayer.com. Inc.
All rights reserved.