Top Banner
1 A tour of Windows Presentation Foundation Mike Taulty Developer & Platform Group Microsoft Ltd [email protected] http://www.miketaulty.com
42
Welcome message from author
This document is posted to help you gain knowledge. Please leave a comment to let me know what you think about it! Share it to your friends and learn new things together.
Transcript
Page 1: A Tour of Windows Presentation Foundation (WPF)

1

A tour of Windows Presentation Foundation

Mike TaultyDeveloper & Platform GroupMicrosoft [email protected] http://www.miketaulty.com

Page 2: A Tour of Windows Presentation Foundation (WPF)

WPF is a framework for rich apps

Page 3: A Tour of Windows Presentation Foundation (WPF)

3

applications built with WPF

Page 4: A Tour of Windows Presentation Foundation (WPF)

built in .NET on top of Direct3D

*this makes graphics cards significant to the performance of the application

man

aged

man

aged

unmanaged

unmanaged

Page 5: A Tour of Windows Presentation Foundation (WPF)

there are 3 public versions

2006 w/Vista

2007w/VS 2008

2008w/VS 2008 Sp1

Windows XP Service Pack 2+Windows XP Service Pack 2+

Windows VistaWindows Vista

Windows 7Windows 7

Page 6: A Tour of Windows Presentation Foundation (WPF)

it provides a unified frameworkVector DrawnVector Drawn H/W AcceleratedH/W Accelerated Retained GraphicsRetained GraphicsLogical PixelsLogical Pixels

LayoutLayout CompositionCompositionDatabindingDatabinding AnimationAnimationTransformatioTransformationn EffectsEffects

Page 7: A Tour of Windows Presentation Foundation (WPF)

development makes use of XAML

eXtensible Application Markup Language

Provides separation of concerns for UI/codeDrives tooling for designer/developer workflowLoad dynamically or compile with codeExtensible to your own types

Page 8: A Tour of Windows Presentation Foundation (WPF)

XAML is often “backed” by code

XAML markup languagedefines UI

.NET code handles interaction

WPF .NET Application

Page 9: A Tour of Windows Presentation Foundation (WPF)

tooling for WPF in 2008Develop with Visual Studio 2008 Sp1Develop with Visual Studio 2008 Sp1

Design Styles & Interaction in Expression Blend 2 Sp1Design Styles & Interaction in Expression Blend 2 Sp1

Page 10: A Tour of Windows Presentation Foundation (WPF)

10

“Hello World” in WPF

Page 11: A Tour of Windows Presentation Foundation (WPF)

rich set of 2D graphical capabilities

Page 12: A Tour of Windows Presentation Foundation (WPF)

12

2D Graphics in WPF

Page 13: A Tour of Windows Presentation Foundation (WPF)

extensible facilities for layout

Page 14: A Tour of Windows Presentation Foundation (WPF)

14

layout in WPF

Page 15: A Tour of Windows Presentation Foundation (WPF)

rich set of 3D graphical capabilities

Page 16: A Tour of Windows Presentation Foundation (WPF)

16

3D Graphics in WPF

Page 17: A Tour of Windows Presentation Foundation (WPF)

rich set of media capabilities

Page 18: A Tour of Windows Presentation Foundation (WPF)

18

media in WPF

Page 19: A Tour of Windows Presentation Foundation (WPF)

capabilities for documents & text

Page 20: A Tour of Windows Presentation Foundation (WPF)

20

documents/text in WPF

Page 21: A Tour of Windows Presentation Foundation (WPF)

rich set of controlsCodePlex adds

WPF ToolkitDataGridCalendarDatePicker

WPF RibbonWPF Futures with more

Page 22: A Tour of Windows Presentation Foundation (WPF)

many controls are content controls

Page 23: A Tour of Windows Presentation Foundation (WPF)

23

content controls in WPF

Page 24: A Tour of Windows Presentation Foundation (WPF)

controls have visual templates

Separation of control behaviour from control appearance

Page 25: A Tour of Windows Presentation Foundation (WPF)

25

templating a control

Page 26: A Tour of Windows Presentation Foundation (WPF)

you can build your own controls

UserControl for composition of controlsPanel for custom layoutControl for ultimate flexibility incl. templating

Page 28: A Tour of Windows Presentation Foundation (WPF)

28

3rd party WPF controls

Page 29: A Tour of Windows Presentation Foundation (WPF)

a unified framework

all with the same, consistent programming model

Page 30: A Tour of Windows Presentation Foundation (WPF)

30

a unified framework

Page 31: A Tour of Windows Presentation Foundation (WPF)

resources and styles

Elements have a dictionary of resources identified by KeyResources from various files can be merged into oneResolution of a resource is a hierarchical lookup

resources

styles

Styles contain setters for Properties and ValuesStyles can be applied by type or by keyStyles can derived from other styles

Page 32: A Tour of Windows Presentation Foundation (WPF)

32

resources and styles

Page 33: A Tour of Windows Presentation Foundation (WPF)

built-in animation system

Animation is driven by Storyboards

StoryboardStoryboard

DoubleAnimationDoubleAnimation

ColorAnimationColorAnimation

etcetc

PointAnimationPointAnimation

Page 34: A Tour of Windows Presentation Foundation (WPF)

built-in triggering system

Declarative means of taking action when something happens

When some propertyWhen some propertyhits some value hits some value

When some dataWhen some datahits some valuehits some value

When some eventWhen some eventhappenshappens

Page 35: A Tour of Windows Presentation Foundation (WPF)

35

animations & triggers

Page 36: A Tour of Windows Presentation Foundation (WPF)

databinding is core in WPF

Elements have a DataContextResolution of declarative bindings is done by hierarchically examining an element’s DataContextButtonButton

GridGrid

Page 37: A Tour of Windows Presentation Foundation (WPF)

databinding is core in WPF

Page 38: A Tour of Windows Presentation Foundation (WPF)

38

databinding

Page 39: A Tour of Windows Presentation Foundation (WPF)

deploying WPF applications

XAML Browser Application(XBAP) ClickOnce Application

Full Client

Page 40: A Tour of Windows Presentation Foundation (WPF)

if we had a day...more topics

*there are no doubt many more topics we’ve omitted

Page 41: A Tour of Windows Presentation Foundation (WPF)

more WPF?

Page 42: A Tour of Windows Presentation Foundation (WPF)

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