windows,windows-runtime,microsoft-metro,winjs,terminate
Those apps have background tasks that are run with a very low resource quota. Your app can have background tasks too, but you need to run within the constraints applied to those tasks. background tasks have no UI and can't depend on the UI parts of your app. See BackgroundTaskBuilder...
javascript,windows-runtime,windows-store-apps,windows-phone-8.1,winjs
Windows Store apps can't use absolute file paths. The correct way to refer to local storage is with ms-appdata:///local/. The ms-appx:/// does the same for in-package contents. However, Windows doesn't allow the app to load/refresh itself from local storage like this, so even using the right URIs you'll get an...
javascript,html5,windows-store-apps,windows-phone-8.1,winjs
Problem was solved by changing class in CSS-file of page created as PageControl. Here's code we need to edit: .fragment { -ms-grid-columns: 1fr; -ms-grid-rows: 128px 1fr; display: -ms-grid; height: 100%; width: 100%; } Just change class in html- and css-file, for example, to fragment2, and nothing breaks when you navigation...
cordova,logging,web-applications,winjs
I suggest separating all the code up to FileIO.appendTextAsync so that you cache a StorageFile object. A StorageFile is really just an abstraction for a pathname to allow for files that aren't actually backed by the file system. Keeping a StorageFile in hand, then, does not mean that you're holding...
java,html,video,windows-8.1,winjs
I solved the issue by setting msZoom propert to true. eg:videoplayer.msZoom = true; documentation...
This actually isn't supported, by design. The principle is that because there isn't all the usual chrome like title bars that typically differentiates between system functions and app functions, the color theme is used instead. That is, the system color scheme exclusively identifies UI that's coming from the system itself,...
Found this code on another question: document.querySelector('body').addEventListener('click', function(event) { if(event.target.id == "main_description"){ } }); ...
windows-store-apps,windows-8.1,winjs
No, by design Windows Store Apps run inside an app container that limits what they're allowed to do without user consent. The only areas of storage that are openly accessible without further consent are the app's package location (which is read-only, see [Windows.ApplicationModel.Package.Current.installedLocation][1]) and its app data folders (see Windows.Storage.ApplicationData)....
windows-8,windows-runtime,winjs
You're correct in that the app host context for a native JavaScript app and the context for a webview are two different things. Only the app host allows JavaScript to talk to WinRT which applies also to WinRT components, as components are structured in the same way that the WinRT...
webview,windows-store-apps,winjs
You should try the ms-appx-web scheme. I believe that if you place the content in a subfolder, ms-appdata should work too. More on this on MSDN...
javascript,windows-phone-8,windows-store-apps,winjs,windows-rt
I mixed filelist and folderlist together causing the app to crash. Creating functions for each process was the solution. var sourceFolder = Windows.ApplicationModel.Package.current.installedLocation; var destinationFolder = Windows.Storage.ApplicationData.current.localFolder; copyDirectories(sourceFolder,destinationFolder); function copyFiles(source, destination) { source.getFilesAsync().done(function (fileList) { if (fileList.size >= 1) { fileList.forEach(function (subFile) { subFile.copyAsync(destination, subFile.name,...
Minification is just one strategy you can employ, depending on your needs. I wrote about this and other options on my blog: http://www.kraigbrockschmidt.com/2013/04/04/protecting-your-code/.
javascript,windows,windows-phone-8,winjs
This is straightforward to do using the function.bind method, and you can even have the handler directly in your Cell class. var Cell = WinJS.Class.define(function(number) { var e = document.createElement("div"); //...and initialize however. this.element = e; e.winControl = this; this.number = number; this.symbol = ""; //Also consider using pointerDown event...
windows-store-apps,winjs,project-siena
Siena has its own importer, which utilizes the fact that xlsx files (Siena doesn't import .xls binary formats) are .zips file with a different extension. It's just unzipping the file and then parsing the XML contained therein. That said, importing Excel data happens in the Project Siena app, not in...
c#,javascript,windows-runtime,winjs,uninstall
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...
xaml,winrt-xaml,winjs,win-universal-app,winrt-component
No. The HTML and Xaml UI stacks in the Windows Runtime are separate and cannot be mixed. You can call non-UI C# or native Windows Runtime Components from JavaScript. You can include HTML in a Xaml WebView, but there is no reverse hosting. --Rob...
javascript,windows-phone,winjs,windows-phone-8.1
You'll have to add some JavaScript to the ready function of a page for example. First get the statusbar for the current view. Than decide what to do with it: var s = Windows.UI.ViewManagement.StatusBar.getForCurrentView(); s.showAsync(); // shows the statusbar More about the statusbar can be found at the MSDN....
listview,winjs,windows-applications
Finally, I managed to get number of items based on win-itemscontainer width. In my case, each item is of 158 px width + 5 px margin. So, item occupies 163px. Now to get number of items, var numberOfElementsPerRow = Math.floor(document.querySelector('.win-itemscontainer').offsetWidth / 163); ...
You can't achieve this in pivot control straight away, but you can get the pivot slide direction in selectionchange event like this, document.getElementById("PivotID").addEventListener("selectionchanged", swipehandler); function swipehandler(evt) { var direction = evt.detail.direction; // 'forward' or 'backwards' } So in this selection change event you can check the length and index of...
If you set the authorization this way: var WebHttp = Windows.Web.Http; // just to fit in StackOverflow :) var authHdr = new WebHttp.Headers.HttpCredentialsHeaderValue("OAuth", authHeader); request.headers.authorization = authHdr; The quotes are not stripped from the value. Depending on what you're trying to do, you may want to take a look at...
windows-phone-8,visual-studio-2013,windows-8.1,winjs,win-universal-app
Windows Phone Emulator requires Hyper-V which needs Windows Pro version. That's probably why you aren't able to start your Emulator. As I've posted in comment, I've heard about VirtualBox and an ability to run WP Emulator on it. Some helpful links: other question on SO, VirtualBox forum, video. I'm not...
javascript,windows-phone-8,windows-runtime,windows-store-apps,winjs
Package contents are read-only, so you cannot replace them at runtime. A general strategy is to copy the package file to your local storage, and reference the image from there using ms-appdata:///local/ URIs (remember to create an instance of Windows.Foundation.Uri when necessary--check the API you're using). Then you can replace...
msbuild,visual-studio-2013,winjs
The problem was in the package.appxmanifest file. Under the Packaging tab, I had set the "Generate app bundle" option to "Always". Setting it to "If needed" fixed the issue and the builds are now successful. UPDATE: The problem reoccurred when we targeted x64 builds only, so we had to keep...
javascript,windows-store-apps,windows-8.1,winjs
Yes there is, take a look at the MediaCapture class. In fact, that's the only way of doing it in Windows Phone (8.1). With that you can have a video element in one of your pages and stream directly what's being seen by the camera. I recently pushed the first...
javascript,c#,push-notification,windows-8.1,winjs
Typically you'd do this by having the C# background task project as part of the same VS solution, and then add a reference from the JS app project to the background task project. I would recommend not ever instantiating the C# component/class from your JS app, as this is not...
In your WinJS Page definition you can define unload method that is always invoked when the user leaves the page. Unregister all event handlers there. WinJS.UI.Pages.define("/page.html", { ready: function (element, options) { // add onclick handler }, unload: function() { // remove here all event handlers } }); ...
javascript,windows-phone-8,windows-runtime,windows-store-apps,winjs
Need to create an URI from the string first. var uri = new Windows.Foundation.Uri("ms-appx:///datafile.xml") Windows.Storage.StorageFile.getFileFromApplicationUriAsync(uri).done() MSDN Link: StorageFile.GetFileFromApplicationUriAsync...
There isn't a good way to do this. Windows Store apps don't have any explicit screenshot API (Windows Phone Store apps do have a phone-only ScreenCapture API) and HTML and JavaScript don't provide a way to render arbitrary HTML to a bitmap (such as Xaml's RenderTargetBitmap). You render the contents...
Kind of simple once you see the API. Use Windows.Storage.StorageFile.getFileFromPathAsync('YOUR_FILE_PATH') .then(function (file) { }); ...
javascript,html5,windows-8.1,winjs,windows-phone-8.1
This is mostly likely caused by the iframe security model. At Features and restrictions by context the table lists Cross-domain XHR requests as being disabled in the web context (which, according to Developing secure apps "remote web content loaded by an iframe is always loaded in the web context"). If...
javascript,winjs,windows-universal
Caveat: Any form of device detection is fragile due to the dynamic nature of hardware - a new device could come along tomorrow that breaks your app's logic. It is best to use these APIs only for telemetry / analytics rather than to trigger runtime behaviour. More often than not,...
visual-studio,cordova,localization,winjs,msdn
I think you are missing the processing for those locale file resources. It should be on the pages/home/home.js on ready handler. Like this ready: function (element, options) { WinJS.Resources.processAll(); . . . } This makes use of the localizations and replaces those to places where they are used....
A Repeater template may have only one direct descendant element (like in the case below, a single child div: <div class="dataColumns" data-win-control="WinJS.UI.Repeater" > <div> <h2 data-win-bind="textContent: Title"></h2> <h3 data-win-bind="textContent: SomeOtherProperty"></h3> </div> </div> Results: You may also consider using a WinJS.Binding.Template for the contents of the Repeater: <div class="template" data-win-control="WinJS.Binding.Template"> <div>...
javascript,html,css,windows-phone-8.1,winjs
Found a workarround: var pivotHeader = document.querySelector(".win-pivot-headers"); if(pivotHeader != null) { var headers = pivotHeader.childNodes; for (var i = 0; i < headers.length; i++) { var badge = document.createElement('span'); badge.id = "unseenConversationsBudge"; badge.innerHTML = "10"; headers[i].appendChild(badge); WinJS.UI.Animation.fadeIn(badge); } } And then handle it in the inicialization event of the app...
javascript,windows-phone-8,windows-runtime,windows-store-apps,winjs
Although you can get document.location and navigation to work (and note that it's document.location, not window.location), the recommended approach is to implement the app like a single-page web application, meaning that you "navigate" by dong DOM replacement inside default.html/index.html. That is, you're page context is always the default HTML page,...
windows-8,windows-store-apps,winjs
I think I found a way to get the CSS to load. I tested the code below by adding a css file that sets the body background to red in the local storage folder. The code reads the contents of the file, creates a style tag in the head and...
cordova,localization,windows-runtime,winjs
Yes you can do that but not directly. Before calling WinJS.UI.processAll you have to read resjson and set the global "strings" variable: var loadLocalRessources = function (language) { language = language || 'en'; return new WinJS.Promise(function (complete, error) { var url = './strings/' + language + '/resources.resjson'; console.log('trying to load...
javascript,queue,promise,winjs,blockingqueue
Your problem is that pendingFiles is always empty. In createTaskForFile, you would set it to an one-element array then, but immediately call uploadNextAsync() which shifts it out. I guess your script might work if you shifted the file after the file has been uploaded. However, you actually don't need this...
javascript,jquery,windows,function,winjs
When working with asynchronous API calls like StorageFolder.getItemAsync, it doesn't work to assign the ultimate result to a local variable and attempt to return that. In your code, moreover, you have two return statements, the first of which returns a promise inside which is wrapped the return value from a...
I got the answer with the help of this post change in my template, <input type="number" class="win-interactive" data-win-bind="value: SelectedQuantity; onclick: clickInTextFunction;" /> change in my modal class, public clickInTextFunction: any; constructor(odataObject?: any) { this.clickInTextFunction = WinJS.Utilities.markSupportedForProcessing((ev) => { ev.stopImmediatePropagation(); }); } ...
WinJS itself doesn't have any functionality particular to hardware devices. It's a general library that contains UI controls and things like promises and data binding, so anything you'd do specific to SmartTVs would have to come from those manufacturer's SDKs. I would imagine those SDKs would have the ability to...
css3,animation,windows-8,windows-8.1,winjs
It turned out nothing was wrong with the animation declaration itself, as expected. We had just wrapped the keyframes definition inside of a media query. Apparently, even though the media query was valid and was being correctly applied, neither IE11 nor Windows 8.1 would render the animation. Long story short,...
windows-8,windows-store-apps,winjs
The second parameter of the first createFolderAsync call should be Windows.Storage.CreationCollisionOption.openIfExists instead of NameCollisionOption. var promises = []; _.each(files, function (file) { promises.push(localFolder .createFolderAsync(folder1Name, Windows.Storage.CreationCollisionOption.openIfExists) .then(function (folder1) { return folder1.createFolderAsync(folder2Name, Windows.Storage.CreationCollisionOption.openIfExists); }) .then(function (folder2) { return folder2.createFileAsync(fileName,...
I see you're including winstore-jscompat.js... Please see this issue: https://github.com/MSOpenTech/winstore-jscompat/issues/8 ..which is fixed in this fork: https://github.com/ClemMakesApps/winstore-jscompat/blob/master/winstore-jscompat.js Note that this will probably be pulled into the main project at some point so this issue should go away "soon"....
javascript,asynchronous,coffeescript,promise,winjs
Let's abstract out the function to break the array into tuples function chunkBy(array, n) { var chunks = []; for (var i=0; i<array.length; i+=n) chunks.push(array.slice(i, n)); return chunks; } and the function that does the work for each item: function tryToLoad(url) { return WinJS.Utilities.Scheduler.schedulePromiseBelowNormal() // not sure .then(function() { return...
camera,windows-runtime,windows-8.1,winjs
Here is the answer: function testSavePictureDisk() { // S1: Create a new Camera Capture UI Object var cam = Windows.Media.Capture.CameraCaptureUI(); //location? var name = document.getElementById('ticketnum').innerHTML + '.jpg'; var folder = Windows.Storage.KnownFolders.picturesLibrary; //was windows.storage // S2: Perform an Async operation where the Capture // Image will be stored as file folder.createFileAsync(name,...
If you modify the HTML as Joel suggests, you need to call WinJS.Binding.processAll on the containing element with its data source to update the actual bindings. That is, the declarative format with data-win-bind are just instructions to processAll for how it uses WinJS.Binding.bind or the data source's bind method (which...
php,windows-runtime,winjs,restful-architecture
Working. Here's the answer: public function uploadpicture(){ if($_FILES['data']['error'] == 0){ // success - move uploaded file and process stuff here echo 'success'; echo var_dump($_FILES) ; move_uploaded_file($_FILES["data"]["tmp_name"],"....server location".$_FILES["data"]["name"] ); }else{ // 'there was an error uploading file' stuff here.... echo 'error uploading file'; } } ...
javascript,windows-8,windows-8.1,winjs
The only workaround I've been able to get to work is to instantiate the template in code, then pass a function to the itemTemplate option when instantiating the ListView. The documentation on what is expected here is sparse, but all of the demos where the ListView is instantiated via code...
If your app is like the sample WinJS app you've linked to, you do not need to wrap it any additional web frameworks. Simply deploy your static /www HTML/CSS/JS files to the root site\webroot web directory. If you deploy the entire Cordova app, including the 'www' folder, you should be...
javascript,windows-store-apps,winjs
You want the pointerOut event, see http://msdn.microsoft.com/library/windows/apps/hh465904.aspx. If you want the full story on pointer events, see my free ebook, Programming Windows Store Apps with HTML, CSS, and JavaScript, 2nd Edition, in Chapter 12.
Don't put question mark in formparams var formparams = "username={email}&password={password}";
javascript,windows-8,windows-8.1,winjs
I found the problem. Referring to the listview by class .itemslist it does not work. Something works differently in the listview when you are coming back from another page as opposed as to when you navigete to the page directly. So I just assigned an ID to the ListView div...
javascript,listview,windows-store-apps,winjs
Overall, the ListView just handles clicks by passing them to whatever itemInvoked handler you register for the control. This means you should be able to just bypass that whole chain and invoke your handler directly with the appropriate item index, which is easy to obtain. Within your item's click handler,...
Okay, shame on me. I was confused by the error message it throwed, but it was just a stupid implementation failure. Removig the <p></p> Tag resolved the problem and the list works like expected. I just needed three hours to figure that out... :/...
UPDATE: Microsoft has made a lot of progress and has now gotten on board with how libraries are normally deployed. You can get it from NPM, Bower, CDN, or create a custom build. Details at http://try.buildwinjs.com/#get Original answer: If you install Visual Studio 2013 (you'll need a x86 or x64...
javascript,windows-store-apps,winjs
Okay, I found a way to do that. First ou need to get the file with getFileAsync() and not the Picker. Then you can create a blob with the stream of your file and add this blob to your form. Here my code var videosLibrary = Windows.Storage.KnownFolders.videosLibrary; videosLibrary.getFileAsync(file.name).then( function completeFile(file)...
If you look in the Navigation template project, you'll see navigator.js in the js folder. This is the implementation of the PageControlNavigator class, so you just need to pull that one file into your Cordova project. This is separate from WinJS. For WinJS itself, the best thing to do it...
javascript,html,windows-phone-8.1,winjs
Do you init appBar variable properly? It's not defined in your code snippet. Try this way, at least it works in my app. <script> (function(){ var appBar = document.getElementById("appBar"); if(appBar.winControl) { appBar.winControl.disabled = true; } }()); </script> Also don't forget that WinJS.UI.processAll runs asynchronously, so your script can't just be...
cordova,windows-phone-8.1,winjs,multi-device-hybrid-apps
Hell, It was just one line. You can close your windows 8.1 apps using window.close(); Edit Some of Microsoft engineers point out the mistake here: window.close() is not a safe way to implement the app, calling this method will break app suspend and resume also might lose data when user...
The tutorial for using WinJS is here: http://azure.microsoft.com/en-us/documentation/articles/mobile-services-windows-store-javascript-get-started-users/ On your client object, call: client.login('microsoftaccount').done(function (result) { // handle successful login }, function (error) { // handle failed login }); More details can also be found in the reference guide: http://azure.microsoft.com/en-us/documentation/articles/mobile-services-html-how-to-use-client-library/#caching...
windows-runtime,winjs,file-uri
Use of the file protocol is not allowed by design, see How to Reference Content, https://msdn.microsoft.com/en-us/library/windows/apps/hh781215.aspx. To reference arbitrary content on a user's hard drive requires user consent, and thus selection of arbitrary files and folder must necessarily go through the File Picker API, or if the user navigates to...
Basically you want return promise1.catch(function(err) { return promise2.catch(function(err) { return promise3; }); }) or (flattened) makePromise1().catch(makePromise2).catch(makePromise3); You can easily create this chain dynamically from an array of to-be-tried functions by using reduce: return promiseMakers.reduce(function(p, makeNext) { return p.then(null, makeNext); }, WinJS.Promise.wrapError()); or if you really have an array of promises...
javascript,html5,windows-runtime,windows-store-apps,winjs
I am afraid your only option is to download the file to local storage, and then go from there.
cordova,windows-8,winjs,mobilefirst
Where are you calling the addEventListener ? Perhaps, the onactivated event has already been raised before you called the addEventListener. I was able to intercept the loading in the cordova.js file and added an event listener and the appropriate function was fired. ...
c#,windows-runtime,windows-8.1,winjs
It's not actually possible to share UI elements between the HTML/CSS rendering engine (the JS app) and a C#/C++ component. The C# code won't have the underlying runtime that understands an HTML element object. Similarly, a UIElement from XAML won't make any sense to the HTML/CSS engine in the JS...
javascript,windows,camera,winjs
I found the problem. The above function was in this code block: WinJS.UI.Pages.define("/pages/queue/view.html", { ready: function (element, options) { } } The problem is: The ready callback is for the DOM elements and not for javascript, so it was still processing aSync code, and WinJS can't handle multiple aSync processes...
use WinJS.Binding.unwrap over the individual elements in the array.
You have to wait, until all resources are loaded. WinJS.UI.processAll().done(function () { document.getElementById("page3").onclick = function () { WinJS.Navigation.navigate("/pages/page3/page3.html"); }; }); More info: https://msdn.microsoft.com/es-es/library/windows/apps/hh440975.aspx...
You should be able to prevent this with the EnsuredFocusedElementInView property. You can register an event listener to fire when virtual keyboard starts showing, and set event.ensuredFocusedElementInView = true to prevent the app from resizing the visual viewport, which is what causes the longer, scrollable, page. // React to Soft...
JavaScript is a native language on Windows and Windows Phone. On these platforms, all JS code in a Cordova app--plugin and app code alike--can call Windows APIs because the code is running in the native app host and not inside a Webview. (I talk about this in an MSDN article...
c#,windows-8,windows-runtime,winjs
I believe what you're missing is a call to Task.Run, which is what actually creates the Task that will run the operation on a separate thread and do the marshaling. That is, your SaveSpreadsheet function says it's returning Task but doesn't actually create the Task anywhere, and is thus just...
windows-store-apps,winjs,appbar
I answer this in my free ebook, Programming Windows Store Apps with HTML, CSS, and JavaScript (2nd edition), in the app bar section (page 480): Tip To prevent the app/nav bar from appearing, you can do one of two things. First, to prevent an app bar or nav bar from...
It's not built in. You'd need to build it, buy it (there may be a third party toolkit that offers similar behavior), or create a Windows Store application.
The only way I have been able to make calling methods on an object work is by passing eval to the invokeScriptAsync method: webview.invokeScriptAsync("eval", "object.subobject1.subobject2.method('arg1', 'arg2', 'arg3');").start(); ...
javascript,html5,windows-phone-8.1,winjs,win-universal-app
If you want to show the contact information to the user and then have them save it, see this walkthrough using the ContactManager.ShowContactCard method.
windows-8,windows-runtime,windows-store-apps,windows-8.1,winjs
Page nav in WinJS is just a matter of DOM replacement. When you do a nav, the target “page” contents are loaded into the DOM and then the previous “page’s” contents are unloaded. You can see this in navigator.js in the _navigating method. It creates a new element for the...
I don't think this title can be edited. The selection screen is something that comes from the OS.
Instead of trying to process pathnames, it will work much better to use a file query, which lets the file system do the search/filtering for you. A query also allows you to listen for the query's contentschanged event if you want to dynamically track the folder contents rather than explicitly...
So I figured out my problem. Apparently you have to register your client-side javascript methods with the hub client before you call $.connection.hub.start(). This post: SignalR JS Client Methods Not Invoked provided the answer. ...
I believe you need to take a look at the MSGestureHold event. You just need to add an event handler for that event. Take a look at the MSGestureEvent object for more events you might need...
%(RecursiveDir) items metadata are available just in case you use wildchar **. See documenation of MSBuild Well-known Item Metadata I’m don't use WinJS but in case Link metadata are used in places where you need reference the files js and css files this could be solution for you: <Content Include="WinJS\**\*.css;WinJS\**\*.js"...