TypeScript, Windows Store apps

Windows Store app with TypeScript and Knockout

In this tutorial we’re going to make a very simple Windows Store app that uses TypeScript. The app is going to use Knockout to handle user input to search patterns on http://colourlovers.com. I assume you have read my previous tutorial on how to set up TypeScript compilation in a Windows Store app. We’ll start with an empty project after adding TypeScript compilation. Packages First we’ll start by adding our dependencies through NuGet. We have a dependency on KnockoutJS, because this is what we need for our bindings. To make the request to colourlovers we are going to use jQuery. First…

TypeScript, Windows Store apps

Enabling TypeScript Compilation in Windows Store apps

TypeScript compiles to JavaScript, thus it can be used in Windows Store apps. Other than with Web applications, where you can configure the way typescript compiles on the project’s property page, with Windows Store apps you’ll have to edit the project file by hand. Which is not that hard. Edit the project file To do this, unload your Windows Store JavaScript application project by right clicking and selecting unload. Right click the project again and select edit. What we need to do is tell MSBuild what it has to do when it encounters a TypeScript file. The whole XML file…

HTML5, JSON, TypeScript, Windows Store apps, WinJs

Combining WinJS, TypeScript, jQuery and KnockOut

In this tutorial we’re going to build a very simple Windows Store application that uses jQuery and Knockout to get some data from the internet and show this in a GridView. I’ll show you how you create a new project, get all the the TypeScript definitions you need, get data from a web service and bind that to the GridView control. I’m assuming you have at least a little TypeScript knowledge. If you don’t you should have a look at the tutorials on http://TypeScriptLang.org first. File – New Start by creating a new project using the template Store apps with…

JSON, TypeScript

Convert json to TypeScript

While working on a Windows Store app I noticed I was writing TypeScript interfaces to get some syntax checking and code completion on JSON data received from an external service. In C# projects I’m used to use http://json2csharp.com to get the C# classes for my JSON and than just deserialize it to those types. I quickly searched the web and realized there wasn’t a similar solution for TypeScript. Solution http://json2ts.com was born. You just paste a block of JSON code into the text area and hit the generate TypeScript button to convert the piece of JSON to a TypeScript definition…

TypeScript, Visual Studio, Windows Store apps

Store app Typescript Project Template

Recently I’ve been writing Windows Store apps using TypeScript. Because TypeScript compiles to JavaScript this can be done without any problems. The hardest part at the moment is getting the project up and running. One of the things is that there’s no official Project Template to start a new project. So I made one myself. Feel free to use it and if you run into any issues please let me know. You can download the template here or get it from GitHub. To use it, first extract the file in the ProjectTemplates folder of Visual Studio 2013. You can find…