Presentation is loading. Please wait.

Presentation is loading. Please wait.

WinJS Priorities max: 15 high: 13 aboveNormal: 9 normal: 0 belowNormal: -9 idle: -13 min: -15.

Similar presentations


Presentation on theme: "WinJS Priorities max: 15 high: 13 aboveNormal: 9 normal: 0 belowNormal: -9 idle: -13 min: -15."— Presentation transcript:

1

2

3

4

5

6

7

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");

10

11

12

13

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); }

17

18

19

20

21

22

23

24

25

26

27

28

29

30

31

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

33

34 Splash screenApp visibleApp ready to use

35 Splash screen App visible App ready to use

36

37 Splash screen App visibleApp ready to use

38

39

40

41

42

43

44


Download ppt "WinJS Priorities max: 15 high: 13 aboveNormal: 9 normal: 0 belowNormal: -9 idle: -13 min: -15."

Similar presentations


Ads by Google