winjs

Metro Style App HTML/JS writing local files

别来无恙 提交于 2019-12-23 04:13:32
问题 I've built an app for Windows Store that writes to local files using Windows.Storage.FileIO (createFileAsync, readTextAsync and writeTextAsync). My plan is to use the file as a simple database (the data is simply JSON formatted user information). Is this a bad idea? Are the files written this way really persistent (or are they deleted when the app is updated)? Can the user themselves delete them (for example through deleting cookies/temp internet files or the likes)? I'm just wondering how

Data Bind failing for Custom HtmlControl inside ItemTemplate of ListView

。_饼干妹妹 提交于 2019-12-23 03:28:34
问题 I have an ItemTemplate which is set on a ListView: <div class="commentTileTemplate" data-win-control="WinJS.Binding.Template"> <div class="commentTileControl" data-win-control="WinJS.UI.HtmlControl" data-win-options="{uri: '/htmlControls/commentTile/commentTile.html'}"></div> </div> The data bindings which are inside the HtmlControl, fails to bind the first time the ListView is shown, on successive runs, it works fine. If I remove the template from the ListView, then the raw data shows up as

Windows 8 how to choose which camera to initialize

我的未来我决定 提交于 2019-12-23 01:37:42
问题 I am developing a Windows Store App and I am using the Camera and Microphone capabilities. I would like the back camera to be initialized but the examples that I have found always initialize the front camera. Here's the code that I have: Windows.Devices.Enumeration.DeviceInformation.findAllAsync(Windows.Devices.Enumeration.DeviceClass.videoCapture) .done(function (devices) { if (devices.length > 0) { // Using Windows.Media.Capture.MediaCapture APIs to stream from webcam mediaCaptureMgr = new

How can I load remote content in a WinJS iframe whilst avoiding SEC7117 errors?

浪尽此生 提交于 2019-12-22 10:37:00
问题 I'm trying to port an existing web app to Windows Phone 8.1 (and later, to Windows 8.1). This is not static content, this is a dynamic page with loads of client-side functionality. My default.html file has <iframe src="https://remote.example.com/app.html"></iframe> . The content in the iframe works in the emulator, and resources that are directly referenced in that initial HTML seems to work. However, my web app but triggers several errors like this: SEC7117: Network request to https://cdn

Is it possible to use Firebase with a Windows 8 app?

好久不见. 提交于 2019-12-22 10:29:56
问题 I'm hoping to use Firebase in my Windows 8 app made using WinJS. Here is how I am trying to write to the root of my Firebase: var dataRef = new Firebase("https://<firbaseName>.firebaseio.com"); dataRef.set("I am now writing data into Firebase!"); However, this gives me the following error in the JavaScript console: Can’t load <https://<firebaseName>.firebaseio.com/.lp?start=t&ser=66595697&cb=2&v=5>. An app can’t load remote web content in the local context. I've tried to add https://

Binding multiple HTML properties using WinJS?

五迷三道 提交于 2019-12-22 00:27:21
问题 WinJS allows you to bind HTML properties dynamically at run-time, similar to XAML binding. <div id="itemTemplate" data-win-control="WinJS.Binding.Template"...> <h3 data-win-bind="innerText: timestamp"></h3> </div> How if I want to also bind the font color style for <h3> as well, how do I achieve that? 回答1: Unlike the data-win-options binding which makes use of {key:value,key2:value2} syntax. data-win-binding uses a syntax similar to inline-css styles. Using property:bindingValue;property2

How to prevent/disable snapped view for Windows 8 Metro UI applications

萝らか妹 提交于 2019-12-21 06:29:44
问题 I have an application that really makes no sense for snapped view, as the content generally represents A4 pages of information and data collection. Is there a way to disable snapped view for the application, or is the recommended approach to just show the application icon, while in snapped mode? 回答1: You cannot disable snapped view. Simply just create a new page and navigate to that page if a snap event occurred. You can simply display an image. Window.Current.SizeChanged += (object sender,

Anyways of running app without requiring Windows 8 Pro version

℡╲_俬逩灬. 提交于 2019-12-20 05:32:14
问题 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? 回答1: Windows Phone

Microsoft Advertising inside win32 app

ε祈祈猫儿з 提交于 2019-12-20 05:24:50
问题 Is it somehow possible to use the new Microsoft Advertising JS modules (From Windows 8 Metro) inside traditional win32 applications? I have win32 application where I would like to implement some Adds with Microsoft Advertising, I don't want to port the application to Metro. 来源: https://stackoverflow.com/questions/28828263/microsoft-advertising-inside-win32-app

What is the alternative to `alert` in metro apps?

我只是一个虾纸丫 提交于 2019-12-19 10:26:10
问题 I created my first app on Windows 8 vs 2012 and it runs and works fine. But when I try to say "helloworld" from JavaScript like this: alert("Hello World"); I get an error: Unhandled exception at line 21, column 13 in ms-appx://1af489cf-bac6-419b-8542-fdc18bdd2747/default.html 0x800a1391 - JavaScript runtime error: 'alert' is undefined What is the alternative if alert is obsolete? 回答1: You should use Windows.UI.Popups.MessageDialog : (new Windows.UI.Popups.MessageDialog("Content", "Title"))