Dela via


Developing an end-to-end Windows Store app using C++ and XAML: Hilo

Next page

The Hilo end-to-end photo sample provides guidance to C++ developers that want to create a Windows 8 app using modern C++, XAML, the Windows Runtime, and recommended development patterns. Hilo comes with source code and documentation.

Download

After you download the code, see Getting started with Hilo for instructions.

Here's what you'll learn:

  • How to use modern C++, asynchronous programming, XAML, and the Windows Runtime to build a world-ready app for the global market. The Hilo source code includes support for four languages and all world calendars.
  • How to implement tiles, pages, controls, touch, navigation, file system queries, suspend/resume, and localization.
  • How to implement Model-View-ViewModel (MVVM) and Repository patterns.
  • How to test your app and tune its performance.

Note   If you're new to XAML, read XAML overview to learn more about its purpose and syntax. Read Tutorial: Create your first Windows Store app using C++ to learn how to create a small Windows Store app with C++ and XAML. Then, download Hilo to see a complete app that demonstrates recommended implementation patterns.

 

Tip  Check out Scott Densmore's presentation where he talks about the Hilo project and offers many of the tips that you'll find in this guide: Tips for building a Windows Store app using XAML and C++: The Hilo project.

 

Note  To learn about building Hilo as a Windows Store app using JavaScript and HTML, see Developing an end-to-end Windows Store app using JavaScript: Hilo. To learn about building a Windows Store business app using C#, XAML, and Prism, see Developing a Windows Store business app using C#, XAML, and Prism for the Windows Runtime.

 

Prerequisites

  • Windows 8
  • Microsoft Visual Studio 2012
  • An interest in C++ and XAML programming

Visit Windows Store app development to download the latest tools for Windows Store app development.

[Top]

Table of contents at a glance

Here are the major topics in this guide. For the full table of contents, see Hilo table of contents.

[Top]

Why XAML?

If you're familiar with Hilo for Windows 7, you might wonder why we chose XAML instead of DirectX for this version. Here is why:

  • This version of Hilo is not a port or rewrite of the original. Instead, it carries forward the spirit of creating a modern photo app for Windows using the latest technologies.
  • The Windows Runtime provides the features that we wanted. XAML is accelerated by graphics hardware, and provides the necessary performance. Therefore, we didn't need to write infrastructure code with DirectX to enable the experience.
  • With DirectX, you have to build all of the UI infrastructure yourself. The Windows Runtime and XAML provide the controls, animation support, and other functionality that supports Windows Store apps.
  • C++ is an imperative language. In a DirectX app, you use C++ to explicitly define what work needs to be done and how that work is done. XAML is a declarative language. We felt that the declarative model enables us to be more productive because we can state how the UI should work, and the Windows Runtime does the work for us. This way we could focus more of our time more on design and core app logic.

Note  

You can also use XAML and DirectX together in your Windows Store app. There are two approaches. You can add XAML to a DirectX app, or you can include DirectX surfaces in a XAML app. Which one to use depends on the nature of the app. For example, an immersive, full-screen 3-D game might use a small amount of XAML for the heads-up display. In contrast, a recipe app for home cooks might use XAML extensively with only a few DirectX surfaces in cases where it needs special visual effects. Although we didn't use DirectX in our app, we created a quickstart that demonstrates how to use SurfaceImageSource to include DirectX surfaces in a XAML app. For more info, see DirectX quickstart in this guide. For additional info, see DirectX and XAML interop and Developing games.

 

[Top]

Learning resources

If you're new to C++ programming for Windows Store apps, read Roadmap for Windows Store apps using C++.

We also found Welcome Back to C++ (Modern C++) and C++ and Beyond 2011: Herb Sutter - Why C++? to be helpful resources for learning more about modern C++. The document Writing modern C++ code explains how we applied modern C++ principles to Hilo.

You might also want to read Index of UX guidelines for Windows Store apps and Blend for Visual Studio for user experience guidelines that can help you create a great Windows Store app. The document Designing Hilo's UX explains how we designed the Hilo UX.

[Top]