winjs

Chaining Promises recursively

半腔热情 提交于 2019-12-02 22:42:42
I'm working on a simple Windows 8 app in which I need to fetch a set of data from a web site. I am using WinJS.xhr() to retrieve this data, which returns a Promise. I then pass a callback into this Promise's .then() method, which supplies my callback with the returned value from the asynchronous call. The .then() method returns another Promise, giving it the value that my callback returns. The basic structure of such a query would be as follows: WinJS.xhr({ url: "http://www.example.com/" }).then( function callback( result_from_xhr ) { //do stuff return some_value; }).then( function

Windows 10 Universal Javascript app SQLite in Windows Mobile 10

无人久伴 提交于 2019-12-02 13:16:43
问题 I currently have a somewhat working Windows 10 Universal app that uses the SQLite wrapper available here. The problem however is, when I deploy the app to a Windows 10 Mobile emulator in visual studio, it ceases to work, and instead gives me the following error: Exception is about to be caught by JavaScript library code at line 401, column 5 in /js/SQLite3.js 0x8007007e - JavaScript runtime error: The specified module could not be found. As this works fine when deploying to local machine, is

How to snap app programmatically in windows 8?

为君一笑 提交于 2019-12-02 12:37:17
问题 how can I programmatically set a windows 8 application to snapped view? Also, what happens if the screen resolution is 1024 where snap is not allowed? Will an exception occur when calling this function? 回答1: To answer your question - how can I programmatically set a windows 8 application to snapped view? Seems it is not possible. Please refer following link. http://social.msdn.microsoft.com/Forums/en-US/winappsuidesign/thread/263b39dd-89d4-4f39-96dc-596a500fa10a 来源: https://stackoverflow.com

ListView add more items in Metro apps?

做~自己de王妃 提交于 2019-12-02 10:10:57
问题 I have a metro application in which I have a Listview and service data contains above 100 items. Initially when am loading listview in my page it has to display only 8 items plus 1 more-related item and later if i click on a more-item it needs add another 9 items to my page and totally it has to show 17 items in my page and need to display more item also like that flow continues.What should I get to get my scenario.Can anyone help me.Below I tried to give u my scenario. Thank you. 回答1: Take a

Update live tile at fixed interval without having the app running

╄→尐↘猪︶ㄣ 提交于 2019-12-02 09:29:57
问题 How can I update my app's live tile at a fixed interval, for example half a day, using JavaScript? Moreover, it has to be able to update even though the app itself is not running (like the weather app for example) EDIT: I want to update it locally without having to connect to the internet. And please give some example in JavaScript, not C# please! To be more specific, for example, how can I set the tile to update once per day, showing the current date? 回答1: You can use a background task on a

How to wait for result of two promises, then do something?

匆匆过客 提交于 2019-12-02 04:05:39
Well, subject. Can't figure out... Condition: both promises start asynchronously and not one after another. Like this: spashGoing.then(doSomethingForItself()); writingGoing.then(doSomethingForItself2()); DoSomethingAfterBothPromises() P. S. I use promises from WinJS, not the ES2015/ES2016, but they don't have big defferences. If WinJS promises are Promise/A+ promises Promise.all([ spashGoing.then(doSomethingForItself), writingGoing.then(doSomethingForItself2) ]).then(function(results) { // do things with results }); Well, answered too soon - WinJS promises are a typical example of Microsoft's

ListView add more items in Metro apps?

ぐ巨炮叔叔 提交于 2019-12-02 03:51:43
I have a metro application in which I have a Listview and service data contains above 100 items. Initially when am loading listview in my page it has to display only 8 items plus 1 more-related item and later if i click on a more-item it needs add another 9 items to my page and totally it has to show 17 items in my page and need to display more item also like that flow continues.What should I get to get my scenario.Can anyone help me.Below I tried to give u my scenario. Thank you. Take a look to this article: http://www.silverlightplayground.org/post/2012/06/10/Metro-Incrementally-load

How to snap app programmatically in windows 8?

亡梦爱人 提交于 2019-12-02 03:41:13
how can I programmatically set a windows 8 application to snapped view? Also, what happens if the screen resolution is 1024 where snap is not allowed? Will an exception occur when calling this function? To answer your question - how can I programmatically set a windows 8 application to snapped view? Seems it is not possible. Please refer following link. http://social.msdn.microsoft.com/Forums/en-US/winappsuidesign/thread/263b39dd-89d4-4f39-96dc-596a500fa10a 来源: https://stackoverflow.com/questions/10668721/how-to-snap-app-programmatically-in-windows-8

Anyways of running app without requiring Windows 8 Pro version

ぐ巨炮叔叔 提交于 2019-12-02 02:56:28
I have been using Windows 8.1 for creating Windows Store apps. Below is output of winver command. I have installed necessary updates to start developing universal Windows Store app using JavaScript. When I try to launch app on Windows Phone emulator, I am getting following error. Unable to start windows phone emulator It also suggesting to use Windows 8 pro version. Is there anyway of running this without requiring to throw more money on getting Windows 8 Pro version? Romasz Windows Phone Emulator requires Hyper-V which needs Windows Pro version. That's probably why you aren't able to start

Update live tile at fixed interval without having the app running

一笑奈何 提交于 2019-12-02 02:49:13
How can I update my app's live tile at a fixed interval, for example half a day, using JavaScript? Moreover, it has to be able to update even though the app itself is not running (like the weather app for example) EDIT: I want to update it locally without having to connect to the internet. And please give some example in JavaScript, not C# please! To be more specific, for example, how can I set the tile to update once per day, showing the current date? You can use a background task on a schedule for an interval for anything greater than 15 mins. The tasks are designed to be run by the OS