Event Interoperability with WinRT

Starting with .NET Framework 4.5, managed code developers can target the new Windows APIs, collectively known as the Windows Runtime (WinRT), directly from their favorite managed languages. To make this work, both the CLR and the language compilers had to be tweaked to provide smooth interoperability between the two worlds.

Although WinRT components share the same metadata format as assemblies used in the .NET Framework, things differ a bit in a few places. One such place is where WinRT events are defined. Although the metadata format is the same, the use of it differs subtly. Let’s take a look.

As described earlier, .NET events are defined as a piece of metadata that ties together two methods: one that’s responsible ...

Get C# 5.0 Unleashed 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.