22
Introduction to building Windows 8 apps using XAML Chris Anderson and Bede Jordan 3-116

App Theming & PVL Direct3DDirectWriteDirect2DMediaTouch

Embed Size (px)

Citation preview

Page 1: App Theming & PVL Direct3DDirectWriteDirect2DMediaTouch

Introduction to building Windows 8 apps using XAML

Chris Anderson and Bede Jordan3-116

Page 2: App Theming & PVL Direct3DDirectWriteDirect2DMediaTouch

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!

Page 3: App Theming & PVL Direct3DDirectWriteDirect2DMediaTouch

Hello XAML C++…

Page 4: App Theming & PVL Direct3DDirectWriteDirect2DMediaTouch

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++

Page 5: App Theming & PVL Direct3DDirectWriteDirect2DMediaTouch

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 6: App Theming & PVL Direct3DDirectWriteDirect2DMediaTouch

<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…

Page 7: App Theming & PVL Direct3DDirectWriteDirect2DMediaTouch

The XAML you know and love…

Page 8: App Theming & PVL Direct3DDirectWriteDirect2DMediaTouch

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

Page 9: App Theming & PVL Direct3DDirectWriteDirect2DMediaTouch

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

Page 10: App Theming & PVL Direct3DDirectWriteDirect2DMediaTouch

Creating a custom control…

Page 11: App Theming & PVL Direct3DDirectWriteDirect2DMediaTouch

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

Page 12: App Theming & PVL Direct3DDirectWriteDirect2DMediaTouch

Multi-touch paint…

Page 13: App Theming & PVL Direct3DDirectWriteDirect2DMediaTouch

PersonalityContractsStore

Building a great Windows 8 app experience means integrating…

Windows 8 apps

Page 14: App Theming & PVL Direct3DDirectWriteDirect2DMediaTouch

Windows 8 personality…

Page 15: App Theming & PVL Direct3DDirectWriteDirect2DMediaTouch

Search contract…

Page 16: App Theming & PVL Direct3DDirectWriteDirect2DMediaTouch

Trial mode…

Page 17: App Theming & PVL Direct3DDirectWriteDirect2DMediaTouch

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

Page 18: App Theming & PVL Direct3DDirectWriteDirect2DMediaTouch

Integrating DirectX content…

Page 19: App Theming & PVL Direct3DDirectWriteDirect2DMediaTouch

• 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

Page 20: App Theming & PVL Direct3DDirectWriteDirect2DMediaTouch

Use XAML with C++, C#, or VB to create native Windows 8 apps!

Page 22: App Theming & PVL Direct3DDirectWriteDirect2DMediaTouch

© 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.