#Win8Dev Tutorial: Understand WinRT Project Templates and Structure


Last day in “Getting Started with Windows Store apps Development” we discussed about Windows Store applications and how to setup your development machine to start with the development. We also discussed it’s four different project categories.

 

Today in this continued series post, we will learn more about project templates in each category and the basic project structure of most used templates.

 

What are the Common Templates in each Category?

Each category has it’s own templates but among them three are common and they are “Blank App”, “Grid App” and “Split App”. You will find them in all the four categories and you will need any one of them while creating your Windows Store applications. Before going to other categories, let’s discuss these common basic templates first.

 

Blank Template

 

“Blank App” template creates a single page project for a Windows Store application which has no predefined controls of layouts. In the UI page, you will see it completely blank and you have to create everything from scratch.

 

Grid Template

 

“Grid App” template creates a three page project structure for a Windows Store application that navigates among grouped items arranged in a grid. The main page display all items in groups. When clicked, the page navigates to details pages of individual item.

 

Split Template

 

“Split App” template generates a two paged project for a Windows Store application that also navigates among a set of grouped items. The main page allows group selection while the other page displays an item list along with details for the selected item.

 

What are the Structures of individual core project?

When you create a Windows Store project with any one of the above mentioned templates, it will create the following project structures (shown as per each individual template):

 

Windows Store Various Project Structure

 

In the above project structures you will see a similarity between each one of them. Every project has two folders, App.xaml, a .pfx file and a .appxmanifest file in it. The basic folders are Assets (used to store resource images required by the application) and Common (to store the common code files used across the application). There is a third folder named DataModel (a repository of Models, View Models and Sample Data Source used by it) available only in Grid and Split project.

 

Each and every project will have a App.xaml file which is the basic entry point to the application, a Package.appxmanifest file to set the manifest information of the app and a [APPLICATION_NAME]_TemporaryKey.pfx file which stores the certificate key information. Rest of them are xaml pages based on the above selection.

 

What are the other Project Templates in each Category?

Apart from the common templates, each category has a set of various templates. Let’s see what are those in each category. This will make it easier for you to chose the category and project template before starting a new project.

 

In Visual C# and Visual Basic category, we have 3 additional project templates named “Class Library”, “Windows Runtime Component” and “Unit Test Library” as shown below:

 

Windows Store (Visual C#) Template

 

The class library project creates a managed class library for Windows Store apps and Windows Runtime Component. Windows Runtime Components can be used by Windows Store apps regardless of the programming languages in which the apps were written. The other template gives you easy access to write unit testing code directly.

 

Windows Store (Visual Basic) Template

 

If you are going to develop a direct 2D or direct 3D application, you should chose Visual C++ category as this category provides you the basic templates to start with that. In this category you will find the following additional templates:

        • Direct 2D App
        • Direct 3D App
        • DLL Library project
        • Static Library for Windows Store apps
        • Windows Runtime Component
        • Unit Test Library

Windows Store (Visual C  ) Template

 

The JavaScript category has “Fixed Layout” and “Navigation” templates to create a static and navigational Windows Store apps.

 

Windows Store (JavaScript) Template

 

Do remember that, if you chose JavaScript category, the application will be build using html, scripts and css where as in other categories the UI of the application will be build in XAML.

 

Summary

Today we discussed about the various project templates and project structures. Up to this, it was just the introduction to Windows Store apps for a beginners who came here to understand the requirements and to kick start their hands dirty with this.

 

From now onwards, we will work on C# category and focus on the development stuffs to learn Windows Store application development and continue on this series. Don’t forget to check out the coming chapters on this topic.

 

Connect with me on Twitter, Facebook and Google+ to get updates and technical discussions. Also subscribe to my blog’s RSS feed and Email Newsletter to get immediate updates on the blog posts. Stay tuned. Happy coding.


1 comments

  1. The window application in by using project templates were great and it were quit interesting .....

    ReplyDelete


 
© 2008-2014 Kunal-Chowdhury.com | Designed by Kunal Chowdhury
Back to top