Chapter 31

Windows Runtime


  • Windows Runtime overview
  • Understanding Language projection
  • Using Windows Runtime components
  • Handling the life cycle of applications
  • Storing application settings
  • Defining and using capabilities


The code downloads for this chapter are found at on the Download Code tab. The code for this chapter is divided into the following major examples:

  • Language Projections
  • Lifecycle Management
  • App Settings
  • Capabilities


Starting with Windows 8, Microsoft offers a new runtime for writing Windows applications with the new style: the Windows Runtime (WinRT). It contains classes with properties, methods, and events, and it uses delegates — so it looks like .NET but it’s a native library. This chapter explains the core fundamentals of the Windows Runtime, demonstrating how it differs from .NET and how you can integrate the two to begin writing Windows 8 applications.

The Windows Runtime is easily accessible from C#, C++, and JavaScript. Although .NET has previously enabled other languages to use the framework, it required the languages to adapt. If you are familiar with JScript.NET, then you know that this is a JavaScript language for programming with .NET. In this case, JavaScript code can be used to directly access methods and properties from .NET classes.

Conversely, the Windows Runtime adapts to different languages, enabling developers ...

Get Professional C# 2012 and .NET 4.5 now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.