Pages

Thursday, 23 August 2012

WinJS: Unpacking Promises


Promises are an abstraction for asynchronous programming. If you don’t know anything about them, I recommend that you first read asynchronous programming in JavaScript before you continue.
A promise is an object. It is not a function and it is not the value returned from the async operation. To get to the value, you need to call the then method on the promise object. You pass a callback function as an argument to then. The promise invokes the callback and passes the value you’re interested in into the callback. Clear as mud, right?

Here’s a fictitious example that pretends like calculating a random number requires an async operation:


getRandomNumberAsync().then(function(someNumber) { 
    // do stuff with `someNumber`
});

Read full article here

Creating a Bar Chart with RadCartesianChart, part of Telerik Windows 8 UI Controls


In an earlier blog post I reviewed how to create a line chart using RadChart for Creating a Bar Chart with RadCartesianChart, part of Telerik Windows 8 UI ControlsMetro. In this blog post I will review how to create a bar chart, and no doubt you will notice some striking similarities.
All of this is done with the Telerik Windows 8 UI Controls.
We’ll begin with the data.  Our bar chart will compare revenues for five stores.
Read full article here

DataStateBehavior for Windows 8 XAML Applications


At Xamling we work very hard to maintain strict standards and practices during development – one reason we do this is to maintain the best parallel workflows between design and development as we can.

Something that we’ve used extensively in the past with Silverlight is the ability to create DataStateBehaviors, which allow us to bind values from our view model to our visual states. When those values change a VisualState is automatically selected, meaning that we can separate our XAML and code very nicely.

Read full article here
Download source from here

Connecting Windows 8 applications with services: Part 2: Working with REST, oData and RSS from Windows 8 applications

Connecting Windows 8 applications with services: Part 1: Using services to get data in our Windows 8 applications

A REST (REpresentational State Transfer) service is based on some basic concepts of the web such as the HTTP protocol and the HTTP verbs (GET, POST…). When using a REST service, we need to send a request to a particular URL and a response will be returned. This response is unique, based on the URL: never should a specific URL return a different schema of the response. The best example of a REST implementation is the web itself: when we send a request to a particular URL, we’ll get back a response. Such a response is generally known as a resource in the REST terminology. The response is plain text, XML or JSON. The schema for this response can be seen as a contract: the service promises that the response will always be of the specified format. This way, we can write parsing code for the schema.

Read full article here
Download source code form here
Web Informer Button