A .NET Developer’s Insight into the Windows Runtime Library

The Windows Runtime Library (WinRT) is the default API for the Windows 8 OS — Microsoft’s 128-bit OS with support for as much as 512 GB of RAM. Built on top of the Win32 API, the WinRT API provides a common platform for designing and developing applications (written in different languages) to execute using Metro style user interfaces in Windows 8.

WinRT essentially is an asynchronous COM-based API that provides an object-oriented runtime environment that sits on top of the Windows kernel (the operating system core that manages memory and other resources in the system). It wraps the Win32 API and extends it to provide support for Metro style applications. Application developers who work with .NET can seamlessly tap into WinRT because it exposes the WPF/Silverlight/XAML model. In turn, Metro style applications can leverage the benefits of hardware acceleration and advanced power management features out of the box. They run in a safe environment and can access all the underlying services of the system on which they are executed.

In the section that follows, I will dive into the Windows Runtime’s design principles, its rich object model and the namespaces it contains.

WinRT Language Support

The major design principles of the WinRT API include support for responsiveness and an asynchronous nature. WinRT APIs are available through many languages like Visual Basic, Visual C#, Visual C++ and JavaScript, and it provides support for language-independent types like integer, enumerations, structures, arrays, interfaces, generic interfaces and runtime classes.

All you need to do is use XAML (Extensible Application Markup Language) markup code to design the user interface for your applications, use C#, VB.NET, or C++ to write the application logic, and then call the Windows Runtime appropriately.

You won’t need to learn a new language to build Metro style applications with WinRT because it is comprised of a COM-based rich object model that is metadata driven and supports common programming constructs. Every Windows Runtime object implements the IUnknown interface. (Actually, all Windows Runtime components implement the IInspectable interface, which in turn derives from the IUnknown interface.)

The Windows Runtime Library provides a language-neutral type system and is exposed through API metadata in the form of .winmd files. Each of these files exposes one or more namespaces. The namespaces contain a collection of types (classes, structures and enumerations). You’ll find the Windows Runtime library files inside the Windows Metadata folder in your system. The best part is that your .NET applications can directly reference Windows Runtime Library components as if they were simple .NET assemblies.

Here is the list of the namespaces that are contained in the Windows Runtime Library:

  • Windows.ApplicationModel
  • Windows.Data
  • Windows.Devices
  • Windows.Foundation
  • Windows.Globalization
  • Windows.Graphics
  • Windows.Management
  • Windows.Media
  • Windows.Networking
  • Windows.Security
  • Windows.Storage
  • Windows.System
  • Windows.UI
  • Windows.UI.Xaml
  • Windows.Web

Summary

The Windows Runtime Library is the Windows 32 API re-imagined for the Windows 8 operating system. It is a new COM-based API that provides support for developing Metro style applications seamlessly. In this article I discussed the WinRT features with special focus on its support for .NET developers to build Metro style applications.

Share the Post:
Share on facebook
Share on twitter
Share on linkedin

Overview

The Latest

iOS app development

The Future of iOS App Development: Trends to Watch

When it launched in 2008, the Apple App Store only had 500 apps available. By the first quarter of 2022, the store had about 2.18 million iOS-exclusive apps. Average monthly app releases for the platform reached 34,000 in the first half of 2022, indicating rapid growth in iOS app development.

microsoft careers

Top Careers at Microsoft

Microsoft has gained its position as one of the top companies in the world, and Microsoft careers are flourishing. This multinational company is efficiently developing popular software and computers with other consumer electronics. It is a dream come true for so many people to acquire a high paid, high-prestige job

your company's audio

4 Areas of Your Company Where Your Audio Really Matters

Your company probably relies on audio more than you realize. Whether you’re creating a spoken text message to a colleague or giving a speech, you want your audio to shine. Otherwise, you could cause avoidable friction points and potentially hurt your brand reputation. For example, let’s say you create a