Posts

Showing posts from 2014

Creating custom controls for Windows Store App (Javascript- WinJS)

Image
Introduction The Windows Library for JavaScript (WinJS) is a library of CSS and JavaScript files. It contains JavaScript objects, organized into namespaces, designed to make developing Windows Store app using JavaScript easier. WinJS includes objects that help you handle activation, access storage, and define your own classes and namespaces. It also includes a set of controls like AppBar, ListView, Rating, TimePicker etc. Though there are many useful controls, they don’t cover all needs (for Ex: A generic control for plotting simple graph, tree view, animation etc.) and it is time for us to develop such custom controls, let’s understand how to do it. Problem Definition Let’s consider a simple problem where it’s required to plot a donut like graph to show up the percentage (%) values in our Windows Store App and it should be able to bind to the ViewModel property. This is how our final graph will look like,  Solution First things first, Include WinJS references in HTML page, be

Enable Windows 8 App(HTML) to make XHR request to service hosted in different domain

Image
Introduction In this small article we are going to learn how to enable our windows 8 app to make a XHR request to service hosted in different domain(e.g Web API hosted in some virtual machine and app in running in my local machine). It seems simple and yes the solution is also simple and straight forward, since I'm new to Win8 app development it took time to understand the things. Lets define the problem. Problem First thing is I have two solutions one is Win8 javascript app solution and another one is service solution I have used Web API for it. Now, when i host my service in local IIS and access the service from my Win8 app it was working i.e i was able to get the data and response status was 200. But when i hosted the same service in some virtual machine(VM) a nd tried to access it was giving 404(Not found) error. SO whats the solution??? Solution The following is my XHR request, WinJS.xhr({             type: "POST",             url: "url"             dat