230 likes | 461 Views
Introduction to building Windows 8 apps using XAML. Chris Anderson and Bede Jordan 3-116. Deliver native Windows 8 apps using what you already know today!. Familiar to Phone, Silverlight, and WPF developers Use C#, Visual Basic, or C++ Built directly on DirectX for world-class performance.
E N D
Introduction to building Windows 8 apps using XAML Chris Anderson and Bede Jordan 3-116
Deliver native Windows 8 apps using what you already know today! • Familiar to Phone, Silverlight, and WPF developers • Use C#, Visual Basic, or C++ • Built directly on DirectX for world-class performance
Complete native implementation built on top of DirectX XAML Architecture Windows 8 app (C++, C#, or VB) WinRT/C++ Projection XAML Platform XAML ABI support XAML Core and Framework (Parser, Controls, Property Engine, Styles, Animation etc.) C++ XAML Graphic Engine Windows 8 Subsystem Media App Theming & PVL DirectWrite Direct3D Direct2D Touch
Multi-threaded architecture to take advantage of multiple cores XAML framework threading model UI thread • Application code runs here • Events are fired here • Framework code: controls, parsing, layout, input processing, text, shapes, etc. Multiple worker threads for image decoding • Running Independent Animations • Processing Independent Input for XAML ScrollViewer element (enables smooth panning and zooming) • Compositing the Scene with Direct3D Compositor thread
Windows 8 XAML is very familiar to WPF, Phone, and Silverlight developers, but there are differences… XAML declarative notation • <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="{StaticResourceApplicationPageBackgroundThemeBrush}"> • <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.)
Controls • Core controls to build a Windows Store app • Basic intrinsic controls • Button, CheckBox, ComboBox, Image, RadioButton, TextBlock, TextBox, ProgressBar, RichEditBox, ToolTip, WebView, etc. • Personality controls • GridView, ListView, FlipView, AppBar, SemanticZoom, ToggleButton, etc.
Creating new controls • One of the key benefits of XAML is extending the control set… • Creating custom controls enables you to extend the capabilities of the platform • If 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++)
Input • Windows Store apps should support mouse, touch, keyboard, and ideally pen as first class input • Pointer represents mouse, touch, and pen • Important 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 8 apps • Building a great Windows 8 app experience means integrating… • Personality • Contracts • Store
DirectX and XAML integration • XAML offers integration of DirectX content through two primary mechanisms • SurfaceImageSource and VirtualSurfaceImageSourceare derived from ImageSource, and enable rich DX content that is relatively static, like image filtering and editing, custom document (for example, CAD) scenarios • SwapChainBackgroundPanelallows 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
Related sessions • 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 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!
Resources • 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 Please submit session evals by using the Build Windows 8 app or at http://aka.ms/BuildSessions