winjs

Local push notification to Win8 Live Tile running JS code inside app

守給你的承諾、 提交于 2019-12-10 19:12:43
问题 I am trying to send updates to my app's tile. This works fine when the app is running. I can, for example, easily send a tile update notification to the tile when the user clicks a button. What I can't work out is how to update the tile when the app isn't working. The only option I have found for this is to poll (or push from) a remote webserver using REST on HTTP . This isn't ideal for me, and I cannot believe that is the only method of updating the tile. Ideal here would be to specify a

Unhandled exception in WWAHost in Cordova APP using Angular

妖精的绣舞 提交于 2019-12-10 18:03:09
问题 I'm currently developing a windows modern app using Foundation for Apps and cordova. The app crashes in many ways during navigation, sometimes even immediately after running it. The crash is this one And i can't manage to debug it in any way. I've tried setting up a window.onerror and a WinJS.Application.onerror catch all function with no results. Apparently the crash happens at a lower level. I've also inspected the event viewer but no info are available. What happens is apparently similar

Windows8: device identifier

六月ゝ 毕业季﹏ 提交于 2019-12-10 17:19:47
问题 I am currently trying to retrieve a unique device identifier. Here is my code: var token = Windows.System.Profile.HardwareIdentification.getPackageSpecificToken(null); var reader = Windows.Storage.Streams.DataReader.fromBuffer(token.id); reader.unicodeEncoding = true; var identifier = reader.readString(reader.unconsumedBufferLength); console.log(identifier); But it raises following error: The operation attempted to access data outside the valid range. How can I retrieve the size of my token

HTTP subtitles in WinJS video element

不羁的心 提交于 2019-12-10 15:43:44
问题 In the HTML media playback sample there's a code that demonstrates how to add subtitles to the video: <video id="subtitleVideo" style="position: relative; z-index: auto; width: 50%;" src="http://ie.microsoft.com/testdrive/Videos/BehindIE9AllAroundFast/Video.mp4" poster="images/Win8MediaLogo.png" loop controls> <track id="scenario3entrack" src="media/sample-subtitle-en.vtt" kind="subtitles" srclang="en" default> </video> It works fine, but when I change subtitle track src to src="http:/

WinJS: Remove tooltip from Slider

徘徊边缘 提交于 2019-12-10 12:43:42
问题 How can i remove the tooltip from a Slider control (input[range]) in WinJS? 回答1: Add the ::-ms-tooltip pseudo element and set display: to none; http://msdn.microsoft.com/en-us/library/windows/apps/hh465805.aspx input[type=range]::-ms-tooltip { display: none; } 来源: https://stackoverflow.com/questions/12882348/winjs-remove-tooltip-from-slider

Universal Windows Application & System.Security.Cryptography

生来就可爱ヽ(ⅴ<●) 提交于 2019-12-10 11:23:41
问题 I currently am developing an app for Windows 10 and have come across a problem. I am using JS and HTML for the UI and was hoping on using C# for code behind. From the limited documentation of this platform, my understanding is that I must use a Windows Runtime Component which then will get referenced by the JS project so that I can call the managed code from it. I then also need to create a Universal Class Library that the Runtime Component will reference. The problem that I am having is that

File to Byte Array in WinJS

血红的双手。 提交于 2019-12-10 09:40:47
问题 I'm tinkering with some Windows Store development in JavaScript and I seem to be stuck on how to get a byte array from a binary file. I've found a couple of examples online, but they all seem to only read in text whereas my file is an image. I'm opening the file like this: Windows.Storage.FileIO.readBufferAsync(photos[currentIndex]).done(function (buffer) { var dataReader = Windows.Storage.Streams.DataReader.fromBuffer(buffer); var fileContent = dataReader.readString(buffer.length);

Open a PDF file from a WinJS Application

≯℡__Kan透↙ 提交于 2019-12-09 06:33:25
问题 I've got an application in which the user clicks a button, and should be presented a PDF that is stored in the application. They can view the PDF internally in the app, or launch the native windows PDF viewer, either way is fine. How can I provide a link / event handler for the button click to launch a view of a PDF file? 回答1: Use the LaunchFileAsync function of the Launcher class, description: Starts the default app associated with the specified file, using the specified options. example

WinRTError: Class not registered

丶灬走出姿态 提交于 2019-12-08 10:43:46
问题 I'm new in TypeScript. I'm getting error when trying to instantiating the class. Below is my sample code, actual code is different can't share. module ABC { export class A { public execute<T>(action: string, data?: any, callerContext?: any): IAsyncResult<T> { // CODE:: var requestMessage = new Common.ClientClasses.ClientRequestMessage(); **// **ERROR- "WinRTError: Class not registered"**** requestMessage.requestUri = actionRequest; requestMessage.method = "POST"; requestMessage.body = data ?

how to set a focus of Listview item in Metro apps?

北城以北 提交于 2019-12-08 09:56:56
问题 I have a listview in my metro-app.I want to set a focus of last-item in my listview?How can I set a focus of a listview-item?Can anyone help me? Thank you. 回答1: You need to use the ListViews currentItem property: http://msdn.microsoft.com/en-us/library/windows/apps/hh700672.aspx Specifically, assign it an object with the index of the data item you want selected (from your data source), and the hasFocus and showFocus properties set: var yourListView = getYourListViewFromSomewhere();