Introduction to building Windows 8 apps using XAML
Chris Anderson and Bede Jordan3-116
Familiar to Phone, Silverlight, and WPF developers
Use C#, Visual Basic, or C++
Built directly on DirectX for world-class performance
Deliver native Windows 8 apps using what you already know today!
Hello XAML C++…
XAML Architecture
Complete native implementation built on top of DirectX
Windows 8 Subsystem
Windows 8 app (C++, C#, or VB)
AppTheming
& PVLDirect3D
DirectWrite
Direct2DMedia Touch
XAML Platform
WinRT/C++ Projection
XAML Graphic Engine
XAML Core and Framework (Parser, Controls, Property Engine, Styles, Animation etc.)
XAML ABI support
C++
XAML framework threading model
Multi-threaded architecture to take advantage of multiple cores
UI thread
Multiple worker threads for image decoding
• Application code runs here• Events are fired here• Framework code: controls, parsing,
layout, input processing, text, shapes, etc.
Compositor thread
• Running Independent Animations• Processing Independent Input for
XAML ScrollViewer element (enables smooth panning and zooming)
• Compositing the Scene with Direct3D
<Page
x:Class="XAMLYouLove.MainPage"
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml">
<Grid Background="{StaticResource ApplicationPageBackgroundThemeBrush}">
<Button Click="Button_Click_1" Content="Hello World" />
</Grid>
</Page>
Evolution of WPF and Silverlight XAML notation
Many type definition features removed (x:SubClass, etc.)
Type system moved to WinRT (clr-namespace: becomes using:, etc)
Object model changes (Names changed, type converters removed, etc.)
XAML declarative notation
Windows 8 XAML is very familiar to WPF, Phone, and Silverlight developers, but there are differences…
The XAML you know and love…
Basic intrinsic controlsButton, CheckBox, ComboBox, Image, RadioButton, TextBlock, TextBox, ProgressBar, RichEditBox, ToolTip, WebView, etc.
Personality controlsGridView, ListView, FlipView, AppBar, SemanticZoom, ToggleButton, etc.
Core controls to build a Windows Store app
Controls
Creating custom controls enables you to extend the capabilities of the platformIf you are writing controls designed to be used by many apps, write them in C++If you are writing controls to be used by a single app, use whatever language blends best with the app (C#, VB, or C++)
One of the key benefits of XAML is extending the control set…
Creating new controls
Creating a custom control…
Pointer represents mouse, touch, and penImportant to remember that you may have multiple contacts (touch and pen) and that there may be high resolution data (primarily pen)
Keyboard supports standard and touch keyboard, however in general, you should use built in text input controls to get full IME and accessibility support
Windows Store apps should support mouse, touch, keyboard, and ideally pen as first class input
Input
Multi-touch paint…
PersonalityContractsStore
Building a great Windows 8 app experience means integrating…
Windows 8 apps
Windows 8 personality…
Search contract…
Trial mode…
SurfaceImageSource and VirtualSurfaceImageSource are derived from ImageSource, and enable rich DX content that is relatively static, like image filtering and editing, custom document (for example, CAD) scenarios
SwapChainBackgroundPanel allows an app to create a full screen IDXGISwapChain in their XAML app, and composite XAML controls and content on top of it, enabling game scenarios
XAML offers integration of DirectX content through two primary mechanisms
DirectX and XAML integration
Integrating DirectX content…
• 10/31 @ 5:15 – B33 KodiakPerformance tips for Windows Store apps using XAML
• 11/1 @ 8:30 – B33 CascadeBuilding world-ready Windows Store apps with XAML
• 11/1 @ 10:15 – B33 HoodXAML list controls
• 11/1 @ 4:15pm – B33 KodiakAnalytics for Windows Store apps
Related sessions
Please submit session evals on the Build Windows 8 App or at http://aka.ms/BuildSessions
Use XAML with C++, C#, or VB to create native Windows 8 apps!
• Develop: http://msdn.microsoft.com/en-US/windows/apps/br229512
• Design: http://design.windows.com/
• Samples: http://code.msdn.microsoft.com/windowsapps/Windows-8-Modern-Style-App-Samples
• Videos: http://channel9.msdn.com/Windows
Resources
Please submit session evals by using the Build Windows 8 appor at http://aka.ms/BuildSessions
© 2012 Microsoft Corporation. All rights reserved. Microsoft, Windows, Windows Vista and other product names are or may be registered trademarks and/or trademarks in the U.S. and/or other countries.The information herein is for informational purposes only and represents the current view of Microsoft Corporation as of the date of this presentation. Because Microsoft must respond to changing market conditions, it should not be interpreted to be a commitment on the part of Microsoft, and Microsoft cannot guarantee the accuracy of any information provided after the date of this presentation. MICROSOFT MAKES NO WARRANTIES, EXPRESS, IMPLIED OR STATUTORY, AS TO THE INFORMATION IN THIS PRESENTATION.