Created
August 8, 2014 18:16
-
-
Save Cengizism/bc9672147a023c8b42ed to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
(function () { | |
2. "use strict"; | |
3. | |
4. WinJS.Binding.optimizeBindingReferences = true; | |
5. | |
6. var app = WinJS.Application; | |
7. var activation = Windows.ApplicationModel.Activation; | |
8. | |
9. app.onactivated = function (args) { | |
10. if (args.detail.kind === activation.ActivationKind.launch) { | |
11. if (args.detail.previousExecutionState !== activation.ApplicationExecutionState.terminated) { | |
12. } else { | |
13. } | |
14. args.setPromise(WinJS.UI.processAll()); | |
15. } | |
16. }; | |
17. | |
18. app.onready = function () { | |
19. var message = document.getElementById('message'); | |
20. var display = Windows.Graphics.Display.DisplayProperties; | |
21. display.addEventListener('orientationchanged', onOrientationchanged); | |
22. | |
23. onOrientationchanged(); | |
24. } | |
25. | |
26. function onOrientationchanged() { | |
27. switch (Windows.Graphics.Display.DisplayProperties.currentOrientation) { | |
28. | |
29. case Windows.Graphics.Display.DisplayOrientations.landscape: | |
30. message.innerText = "Display Orientation - Landscape"; | |
31. break; | |
32. | |
33. case Windows.Graphics.Display.DisplayOrientations.portrait: | |
34. message.innerText = "Display Orientation - Portrait"; | |
35. break; | |
36. | |
37. case Windows.Graphics.Display.DisplayOrientations.landscapeFlipped: | |
38. message.innerText = "Display Orientation - Landscape (flipped)"; | |
39. break; | |
40. | |
41. case Windows.Graphics.Display.DisplayOrientations.portraitFlipped: | |
42. message.innerText = "Display Orientation - Portrait (flipped)"; | |
43. break; | |
44. | |
45. default: | |
46. message.innerText = "Unknown"; | |
47. break; | |
48. } | |
49. | |
50. } | |
51. | |
52. app.oncheckpoint = function (args) { | |
53. }; | |
54. | |
55. app.start(); | |
56.})(); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment