Win rt fundamentals


Published on

Slide Deck of my presentation at the SoCal Code Camp June 23rd 2012 in San Diego
WinRT Fundamentals by Kevin Stumpf

Check out the corresponding blog post:

This presentation was highly code and talk laden, so the deck itself might not be too useful if you haven't attended my session. However, attendees asked me to publish the slides... so there they are :-)

Published in: Technology
  • Be the first to comment

No Downloads
Total views
On SlideShare
From Embeds
Number of Embeds
Embeds 0
No embeds

No notes for slide

Win rt fundamentals

  1. 1. Kevin Stumpf Sr Software
  2. 2. 1. Short introduction to Windows 82. Windows Runtime (WinRT)3. Ways to develop Metro style apps for Windows 84. Language Projection5. .NET’s role in the WinRT world6. XAML Differences to WPF7. Limitations
  3. 3. Important facts about Windows 8
  4. 4. 1. Hybrid OS2. Contracts3. Security System
  5. 5. App exposes publishes Capabilities restrictsMarketplace Broker Network (Client/Server) Shared Directories Hardware • Documents • Webcam • Videos • Microphone • Pictures • Proximity • Music • GPS
  6. 6. 1. Knowledge applies to Desktop, Tablet & WP82. The future is handheld 1. Consumer Market 2. Corporate Market (Hotel Check-Ins, Nurses, etc.)3. Develop commercial Apps for the Marketplace4. Strong Marketing from Microsoft as their Metro Ecosystem is vital
  7. 7. What the WinRT is about andhow it is integrated in the Win32world
  8. 8. 1. Windows 8 Architecture2. WinRT vs. Win323. WinRT API
  9. 9. Diagram from
  10. 10. Diagram from
  11. 11. asynchronous object oriented private based on extended COM Hierarchical self-explanatory namespaces
  12. 12. Ways to develop Metro style appsfor Windows 8
  13. 13. 1. Dependency Diagram2. Metro style GUI development 1. XAML 2. “HTML5”/CSS3. Business Logic development 1. JavaScript 2. C# / VB 3. C++
  14. 14. CX WRL
  15. 15. How C#, JavaScript and C++ canaccess the very same WinRT API
  16. 16. 1. WinRT API Metadata2. Projection explanation3. Projection areas
  17. 17.  WinRT API is described by .winmd Files Only Metadata, no implementation Foundation for the Language Projection Format follows ECMA-335 standard (Common Language Infrastructure) Independent from .NET, although it shares the same file format Files can be disassembled using IL Location: C:WindowsSystem32WinMetadata
  18. 18. WinRT API(Metadata) Type Projections Naming Projections Pattern Projections
  19. 19. .NET’s role in the WinRT world
  20. 20. 1. Integration in WinRT2. Metro style subset3. Visual Studio Project types
  21. 21.  C#/VB is NOT compiled against WinRT, it is still compiled to the same MSIL and then JIT- compiled at runtime by the CLR Executing CLR is the same for Desktop and Metro style based apps Desktop and Metro style both use .NET 4.5 Metro style uses a constrained .NET subset which is just another .NET Profile (similar to Silverlight, WP7) Metro style apps in addition reference the WinRT by referencing Windows.winmd CLR communicates with WinRT A .NET developers view of Windows 8 app development
  22. 22.  Subset restricts functionality at development time that would be forbidden by the application container at runtime Certain functionality was moved to the WinRT API (File access, network) to avoid redundancy Certain functionality was completely removed ◦ Dangerous/ Obsolete / Legacy APIs ◦ Badly designed APIs ◦ Not applicable anymore (Console, ASP.NET) Refactorings
  23. 23.  No exceptions with a full stack trace anymore! Instead, HRESULTS and wild guessing Debugging is limited: No reflection of the framework’s implementation is possible anymore
  24. 24. Major changes between WPFXAML and WinRT XAML
  25. 25.  No MultiBindings No RadialGradient Brushes No PixelShader effects for UIElements No RelativeSource->FindAncestor Bindings No Implicit DataTemplates No Triggers, just VSM No Markup Extensions
  26. 26. WinRT Limitations and how youcan overcome some of them
  27. 27.  WinRT API only addresses the most common use cases A subset of COM and Win32 functionality is available to address other scenarios such as ◦ Accessing raw data from the webcam ◦ DirectX ◦ Diagnostics ◦ …
  28. 28.  .NET World: Pinvoke C++: Import the Win32 library and invoke the imported method JavaScript: No winmd metadata available => Not callable from JavaScript. Workaround: Build a C++ or .NET WinRT component that wraps the C++/COM functionality of interest
  29. 29. Kevin Stumpf –