winjs

Navigate to a specific html page on clicking toasts with params (WinJS)

不想你离开。 提交于 2019-12-12 03:24:22
问题 I have a WinJS project and I receive toasts notification from my webservice. In my webservice my XML is like: string type = "Computer"; string toast1 = "<?xml version=\"1.0\" encoding=\"utf-8\"?> "; string message = "{\"Message\":{\"Id\":\"6724d22a-87fe-4137-b501-9d9a9a0558b1\",\"DetailId\":\"dc02e784-7832-4625-a538-29be7f885ccb\",\"Description\":\" Message\",\"UserName\":null,\"ActionDateTime\":\"2015-09-15T15:36:14+05:45\",\"CalamityId\":\"c0fa848e-ee6c-4b91-8391-a12058f25387\",\

Best practice to avoid clashing promises in js

二次信任 提交于 2019-12-12 02:49:54
问题 I have a save function in my app which can be called manually and an autosave function which runs every 60 seconds. To prevent the two ops trying to access the same file at the same instant, I set a flag called isSaving to true when one starts running, and to false again afterward. If open or save detect that autosave is running, they wait 1000ms and try again. If they fail after that I consider it an error. Autosave: setInterval(autosave, 1000 * 60); isSaving = false; function autosave() {

Windows8 Push Notifications in Metro Application using HTML5 [closed]

徘徊边缘 提交于 2019-12-12 00:21:29
问题 As it currently stands, this question is not a good fit for our Q&A format. We expect answers to be supported by facts, references, or expertise, but this question will likely solicit debate, arguments, polling, or extended discussion. If you feel that this question can be improved and possibly reopened, visit the help center for guidance. Closed 7 years ago . I have a metro application in which am trying to display notifications whenever my service get updated.I tried to read Metro App push

WinJS Promise based file upload queue

青春壹個敷衍的年華 提交于 2019-12-12 00:02:06
问题 Scenario I need a background upload queue that sends files to a server. The queue should send the files in sequential order as they are pushed into the queue (FIFO). My solution var pendingFiles = []; var filesOperation = null; uploadNextAsync = function(file) { var next; if (!pendingFiles.length) { return WinJS.Promise.as(); } next = pendingFiles.shift(); fileslogger.debug("Uploading " + next); return fileQuery.folder.getFileAsync(next).then(function(file) { return Server.sendFileAsync(file)

Detect when your windows 8 app is uninstalled?

痴心易碎 提交于 2019-12-11 23:16:47
问题 How can I tell using c# or winjs when your app that the user downloaded is being uninstalled? Can you call home, or try to save the client by giving/redirecting them to a site with an exit poll? 回答1: Not supported. A key goal with the Windows Store is to make it seamless and painless for consumers to try apps. One result of this is that Store apps don't have any control over or hooks into install/uninstall processes. Bottom line is that the act of uninstall is not a time to try to exercise

Bind itemDataSource to select html element?

拥有回忆 提交于 2019-12-11 15:09:43
问题 Is it possible to bind a List-Binding to a HTML Select () element to display the contents of the binding as elements? Im using this right now, which doesn't seem to work: <select data-win-options="{itemDataSource: ...)}"></select> 回答1: There is a programmatical way without declarative binding: JavaScript part: // Load data var options = [ { optionValue: 1, optionText: 'One', selected: false }, { optionValue: 2, optionText: 'Two', selected: true }, { optionValue: 3, optionText: 'Three',

Call Native C# from WinJS that's loaded in a WebView

核能气质少年 提交于 2019-12-11 12:14:32
问题 I know it's possible to call native C# from WinJS by creating a Windows Runtime Component and then adding it as a reference to the WinJS app -- but is it possible to do the same thing from the WinJS app when it's loaded inside a WebView ? I've tried it, but it seems the WinJS app inside the WebView is operating in a completely different context or something and isn't finding the symbols, so it crashes and offers to launch a new instance of VS2013 to try and debug. 回答1: You're correct in that

For loop not waiting for winjs promise completion

拟墨画扇 提交于 2019-12-11 10:26:38
问题 For loop not waiting for winjs promise completion for (var j = 0; j < magazineResult[0].data.length; j++) { downRequest[0].data[j].COVER_PAGE_THUMB = parentUrl + eval(JSON.stringify(downRequest[0].data[j].COVER_PAGE_THUMB)); // Create a new download operation. downloadFile(eval(magazineResult[0].data[j].COVER_PAGE_THUMB),eval(JSON.stringify(magazineResult[0].data[j].COVER_PAGE_THUMB))); var url = downRequest[0].data[j].COVER_PAGE_THUMB; var imgPath = downRequest[0].data[j].ISSUE_ID; var

WinJS: Nested ListViews

孤人 提交于 2019-12-11 10:21:30
问题 I have problem with nested ListViews in a Windows 8 Metro application. I get error: Exception was thrown at line 5840, column 33 in ms-appx://microsoft.winjs.1.0/js/base.js 0x800a138f - JavaScript runtime error: Unable to get property 'dataSource' of undefined or null reference The code is: <div id="color" data-win-control="WinJS.Binding.Template"> <div>color</div> </div> <div id="row" data-win-control="WinJS.Binding.Template"> <div> <div>row</div> <div data-win-control="WinJS.UI.ListView"

How do i set the id in WinJS.Binding.Template in a Win8 App

冷暖自知 提交于 2019-12-11 10:15:53
问题 The following html is not working for me. <div id="weightListViewTemplate" data-win-control="WinJS.Binding.Template"> <span data-win-bind="innerText: name; id: id"></span> </div> <div id="basicListView" style="width:420px;height:600px" data-win-options="{ itemTemplate: select('#weightListViewTemplate') }" data-win-control="WinJS.UI.ListView"> </div> The list appears but the ID property is not set on the span objects. How to a set the id of the span dynamically in the template based on the