App architecture
Learn about the programming options for Windows Store apps.
Overview
Starting in Windows 8, you have a number of options for programming Windows Store apps.
You can create apps by using any of these programming languages:
- JavaScript and HTML5
- C# and Extensible Application Markup Language (XAML)
- Microsoft Visual Basic and XAML
- Visual C++ component extensions (C++/CX) and XAML
- C++/CX and Microsoft DirectX
Microsoft Visual Studio and Blend fully support designing, developing, and debugging in all of these languages. Choose the language for your app depending on your experience and its suitability for the kind of app that you're developing.
App model architecture
Each programming language has a corresponding app model. The app model is a set of files and design patterns that express an implementation architecture. An app model is to application design as a data model is to database design.
App models are characterized by a number of features, like the app's entry point in code, the file layout in the solution, and the presentation technology.
Entry points
The app's entry point is the function or method that the system calls to start running your app's code. The entry point depends on the programming language. By default, the Visual Studio project templates define the app model architectures, which are shown in the following tables. You have considerable freedom to customize these defaults, but only advanced developers should attempt this.
This table shows the entry points and their default file locations for each app model.
| App model | Entry point | File location |
|---|---|---|
| JavaScript | onactivated function | default.js in js folder |
| C#/Visual Basic | OnLaunched method | App.xaml.cs / App.xaml.vb |
| C++/CX with XAML | OnLaunched method | App.xaml.cpp |
| C++/CX with Microsoft Direct3D | main function | Direct3DApp1.cpp |
Presentation technologies
The app model's presentation technology defines the look and feel of the app. You can create Windows Store apps by using three distinct technologies: XAML, HTML5, and DirectX. This table shows the programming languages that you can use with particular presentation technologies.
| Programming language | Presentation technology |
|---|---|
| C#/Visual Basic | XAML |
| JavaScript | HTML5 |
| C++/CX | XAML, DirectX, and XAML/DirectX interop |
Assets
Required assets for Windows Store apps are four images, named Logo.png, SmallLogo.png, SplashScreen.png, and StoreLogo.png.
| App model | Location of assets |
|---|---|
| JavaScript | images folder |
| C#/Visual Basic | Assets folder |
| C++/CX with XAML | Assets folder |
| C++/CX with Direct3D | Assets folder |
Asynchronous programming
| App model | Asynchronous |
|---|---|
| JavaScript | Common JS Promises/A |
| C#/Visual Basic | async/await keywords |
| C++/CX | task class / IAsyncOperation |
Creating Windows Store components
You can factor your code into reusable components for your Windows Store apps, which are named Windows Runtime Components. There are specific interface requirements that Windows Runtime Components must adhere to. You can create Windows Runtime Components by using C#, Visual Basic, or C++/CX app models, but not JavaScript. For JavaScript, you create reusable modules by factoring code into files that you include in different projects.
You can't create standalone, reusable software libraries for distribution in the Windows Store. Your reusable libraries must ship with an app.
For more info, see Creating Windows Runtime Components.
Packaging and deployment
Package your apps for deployment by using the Manifest Designer in Visual Studio. The Manifest Designer provides a simple user interface for changing settings in the app manifest file, which is named Package.appxmanifest. This procedure is the same for all of the app models.
For more info, see App packages and deployment and Deploying Windows Store apps from Visual Studio.
Uploading your app to the Windows Store
All languages can use Windows Store components. You can create components in any programming language, except for JavaScript.
Build date: 6/14/2013
