Wpf4 july2010

53
WPF 4

Transcript of Wpf4 july2010

Page 1: Wpf4 july2010

WPF 4

Page 2: Wpf4 july2010

Ted Hu :: [email protected] / twitter: @tedhu Community Program Manager Microsoft Windows Presentation Foundation

Page 3: Wpf4 july2010

Objectives

Give You A Concrete Understanding of WPF 4New Features in WPF 4Windows 7 light upTooling improvements

Tells You Which Features Can Also Be Used With .NET 3.5SP1 and How

3.5 SP1 is Preinstalled with Windows 7

Answer Questions (during Q&A)

3.5 SP1

Page 4: Wpf4 july2010

.NET 3.5 SP1Prior Art

Released on 11 August 2008

Number Of Bug Fixes And Improvements

Feature-packed Service ReleasePerformance. 15-45% performance improvements for key startup and runtime scenarios

Startup: Optimizing CLR NGEN layout, disk I/O, JIT code genRuntime: Graphics, data, text, to animation

Deployment. .NET 3.5 SP1 Client Profile, ClickOnce

Graphics. Extensible Shader Effects with HLSL support, Direct3D Interop 3.5 SP1

More @ http://windowsclient.net/wpf/wpf35/wpf-whats-new-

35sp1.aspx

Page 5: Wpf4 july2010

History

WPF Silverlight2001 Started development

2005 Started development

2006 WPF 3.0 (v1)

2007 WPF 3.5 Silverlight 1

2008 WPF 3.5 SP1 Silverlight 2

2009 Silverlight 3

2010 WPF 4 Silverlight 4

• Released 4 major versions of WPF and 4 major versions of Silverlight• Common set of tools (VS, Blend), and programming model (XAML, .NET)• Redefined RDA and RIA programming

Page 6: Wpf4 july2010

WPF 4 - Lots of Good Stuffo XAML

o Cached compositionso Text clarityo Layout Roundingo ClickOnce improvementso Multitoucho Win7 Taskbaro Win7 Ribbon o Focus mgt improvementso Support for UIAccessible2o VSM integrationo Full Trust XBapso Pixel Shader 3

o Client Profileo Data controlso Accessibility Improvementso Chart Controlso Control Themeso Hundreds of good bug fixes…o Plus all the goodness of .NET 4!

– Dynamic Language Support– MEF– Globalization and NLS

improvements– Managed / Native Code

interopMore…

Scott Guthrie’s WPF 4 blog post http://weblogs.asp.net/scottgu/archive/2009/10/26/wpf-4-vs-2010-and-net-4-0-series.aspx

Page 7: Wpf4 july2010

WPF 4

Windows 7Taskbar Integration Multitouch

Improved FundamentalsGraphics: Cache Composition, Pixel Shader 3New Text Rendering StackLayout RoundingDeployment Streamlined : Client Profile, ClickOnce

Enabled Visual Studio’s UI and Editor

Better Tooling

Page 8: Wpf4 july2010

WPF for Windows 7 Rapid Application Development on Win7 Innovations

Multi-TouchTaskbarDirectWrite for Text RenderingControl Toolkit (Ribbon, etc.)Common DialogsFile Explorer Presence and CustomizationMore…

Use with .NET or via XAML in WPF

Page 9: Wpf4 july2010

WPF Taskbar Integration

Thumbnails toolbars

Icon overlays

Progress bars

Jumplists

With XAML Support3.5 SP1

Page 10: Wpf4 july2010

<Application x:Class="Fishbowl.App"> <JumpList.JumpList>

<JumpList ShowRecentCategory="True"> <JumpTask Title="Slideshow" Arguments="/Slideshow" /> <JumpTask Title="Latest News" Arguments="/Newsfeed" /> <JumpTask Title="Sync Now" Arguments="/Synchronize" /> </JumpList> </JumpList.JumpList></Application>

3.5 SP1

Page 11: Wpf4 july2010

WPF 4 MultitouchUIElement changes

Manipulation Events (tracking and interpreter)Touch System Gesture events (double-tap, rollover)Raw Touch Input Events (for going to the metal)

Multi-touch support in controlsScrollViewer Update to accept pan gesturesBase Controls Updated to be multi-touch awareMulti-capture Support for more than one contact point at timeNew Multi-touch Controls e.g. ScatterView

Compatible with Surface SDK 2.0

Page 12: Wpf4 july2010

Surface HardwareWindows 7

Surface HardwareWindows

VistaWindows 7

NativeWin32

Application

WPF 3.5

Surface SDK1.0

Managed Wrapper and

Interop

Managed Wrapper and

Interop

WinForms Application

Windows 7 ReleaseNET 4 / Surface 2.0 Release

WPF 3.5 SP1

WPF 4

Surface SDK 2.0

WPF Applicatio

n

Surface Applicatio

n

Multi-Touch Controls

Multi-Touch API

Surface Multi-Touch Controls &

API

Multi-Touch API

Multi-Touch API and Controls

Touch Development Roadmap

Page 13: Wpf4 july2010

demo

Available now at http://fishbowlclient.com

MultitouchTaskbar

Microsoft Pivot Seesmic Look

Page 14: Wpf4 july2010

WPF 3.5 SP1 Multi-Touch Support

Enabling Multi-touch InputMulti-touch Input via Stylus eventsImplementing Multiple CaptureUsing Win7 Manipulation and Inertia Processors

Windows Multitouch Sample .NET Interop Library http://code.msdn.microsoft.com/WindowsTouch

14

3.5 SP1

Page 15: Wpf4 july2010

Windows API Code Pack for .NET

Vista and Windows 7Restart and RecoveryTransactionsSearchNetwork and power aware

Windows 7Sensor PlatformFederated SearchControlling any related servicesMore…

3.5 SP1

Page 16: Wpf4 july2010

FundamentalsA Quality-First Release

Framework DeploymentApplication DeploymentText ClarityLayout Rounding / SnappingGraphics PerformanceImproved InteropUIAutomation – For accessibility and VS Test Tools

Page 17: Wpf4 july2010

Framework Deployment

.NET 4 is a Side by Side release!Visual Studio 2010 supports multi-targeting (e.g. Silverlight + WPF v3 and 4)Client Profile SKU & Setup Improvements

Page 18: Wpf4 july2010

Client Profile SKUSmaller, Faster NET Framework SKU

.NET Framework Client: 28mbSetup optimizations for ngen, download, etc.Works across ALL CONFIGURATIONS

Brandable deployment experienceDevelopers can customize app deployment experience to match brandCan integrate framework and app installersTools and documentation for creating these packages

Easier application deploymentDevelopers may use deployment bootstrapper to manage the installation of their app and pre-reqsWill install application after the framework and launch it (.msi, .application or .xbap) 3.5 SP1

Page 19: Wpf4 july2010

Setup and Size.NET 4 Client Profile is the default target in almost all VS 2010 Client Project Templates (WinForms, WPF, VSTO)

Supported on all OS that Full .NET is

.NET 4 Full & Client offer big improvements

75%+ size reduction over earlier versions48 MB Full (x86/x64); 28 MB Client (x86)Both Full and Client Support x86 & x64

Size on media combined x86/x64 package

"2.0" "3.0" "3.5" "3.5SP1" "4.0 Full" "4.0 Client"

0

50

100

150

200

250

Siz

e in

Megabyt

es

.NET 4 Full (x86/x64)

.NET Client (x86)

0

10

20

30

40

50.NET 4 Full (x86/64) &

Client (x86)

Siz

e in

Meg

ab

yte

s

Page 20: Wpf4 july2010

Setup and Client Profile .NET 4 Full & Client Profile Size & Deployment Perf

Client x86=~28MB, Client x86/x64=~41MB (similar size to x86 3.5SP1 Client Profile with lots more features )

Full x86=~35MB , Full x86/x64=~48MB (from ~240MB in 3.5Sp1 )

Client Profile is a First-Class CitizenClient Profile Is The De Facto Framework that will be available on Windows Update for desktop PCs

Can Be Serviced Independently (of Full Framework) as Standalone & serviceable package (does not require Full Framework)

Supported by Visual Studio 2010 in all respects (e.g. targeting, deployment project, etc).

Page 21: Wpf4 july2010

demo

Available now at http://photosuru.com

Client Profile

Page 22: Wpf4 july2010

What is ClickOnce?

Technology to help deploy, version and update rich clientsSupports automatic detection and deployment of application updatesProvides bootstrapping capabilitiesApplications execute in a secure sandbox with support for safe permission elevation

Page 23: Wpf4 july2010

ClickOnce Deployment

Originally released with .NET Framework 2.0 .NET Framework 3.5

Can move deployment locationsCan support third-party publishing and brandingManifest Generating and Editing Tool improved

.NET Framework 3.5 SP1Can publish unsigned applicationsBetter FireFox supportDesign-time file associations

Page 24: Wpf4 july2010

ClickOnce Deployment

Continuing Improvements For ClickOnce to enable more seamless app install & update

Command-line arguments for CO-deployed apps

File associations for CO deployed apps

Background auto-updates and custom install User Experience

3.5 SP1

Page 25: Wpf4 july2010

The ClickOnce Experience

Web Server

Page 26: Wpf4 july2010

MyApp_1.0.0.0

Publish.htm

MyApp

MyApp_1.1.0.0

Client Workstation

MyApp.application

MyApp V1 Domain

Web Server

Check manifestfor updates

Download updates

Publish.htm

MyApp.exe.manifest

Deploying Using ClickOnceOnline-Only Update Scenario

HTTP

Page 27: Wpf4 july2010

ClickOnce Background Update

demo

Page 28: Wpf4 july2010

Problems Solved by ClickOnce

Choice of web, UNC or CD installationOn demand feature deploymentAutomatic application updatesSupport for application rollbackRemoval of version conflicts

…Administrators can control how applications are granted permissions, safe elevation

Page 29: Wpf4 july2010

(Pre-4) WPF Text Rendering

Page 30: Wpf4 july2010

WPF 4 <left> vs. GDI <right>

Page 31: Wpf4 july2010

<Page

... <StackPanel

TextOptions.TextRenderingMode="ClearType" TextOptions.TextFormattingMode="Display">  

  <TextBlock Text="This will use Display mode

formatting and render with ClearType"/>

</StackPanel>   </Page>

Text in WPF 4 APIs In a Nutshell

Page 32: Wpf4 july2010

Text APIs

TextFormattingModeIdeal. Maintains high fidelity with their outlines from the font file (default behavior which uses IdealWidth text metrics)

Display. Glyph has width of multiple whole pixels and is positioned on whole pixels (optional new behavior which uses CompatibleWidth text metrics)

When To Use Ideal ModeLarge Text – As text size increases, Ideal clarity issues dissipate. After ~15pt, Ideal mode is as clear & better spaced than display mode text

Transformed Text – If transform is applied to text, Ideal mode should be used. Ideal mode text is designed to be drawn anywhere

Zoomed Text – Zooming text is a special case of transformed text. Zoomed text should be implemented by increasing the text size

When To Use Display ModeSmall Text – Smaller WPF text (<~15pt) can appear more blurry. If so, switching to display mode should help

Page 33: Wpf4 july2010

Text APIs

TextRenderingModeAliased (aliased rendering)Grayscale (grayscale antialiasing)ClearType (ClearType always on)Auto (ClearType unless otherwise specified in the system font smoothing options)

Comparison of ClearType ,Grayscale, Aliased text using Display TextFormattingMode

Page 34: Wpf4 july2010

Text Improvements

demo

Page 35: Wpf4 july2010

Layout Rounding

WPF Uses DPI-independent Graphics System

Objects Fall “Between Pixels”Side Effects: Rendering Artifacts

Anti-aliased blurrinessSemi-transparent edges

Layout RoundingNon-integer Pixel Values Are Rounded To Whole Numbers during Measure and Arrange

UseLayoutRounding. Rounds an object’s coordinates on whole pixels

Page 36: Wpf4 july2010

Layout Rounding

demo

Page 37: Wpf4 july2010

Graphics

Composition API – give application authors fine grained control over caching rendered elements in video memory

An input to a shader effectA brush to fill any arbitrary 2D shapeA texture on a 3D model

Text Rendering – New and Improved (on all Windows versions)

Pixel Shader 3 Support 256 65,000 instructionsExtends 3.5 SP1’s ShaderEffect with PS 3 supportTools like Shazzam edit and test Pixel Shader Effects

http://www.shazzam-tool.com

Page 38: Wpf4 july2010

Cached Composition

BitmapCache enable caching of entire or partial visual tree

Avoids Re-rendering Costs per-frame Significant Performance improvements possible Fully Interactive. Remains responsive to user inputRespects Dirty Regions and invalidates accordingly

Fine-grain control for quality of Cached visualRenderAtScale. Fine-grain knob to set trade-off between re-rendering costs vs. quality, e.g. Processor/memory ++ 1, 2, 20X…n scale

Page 39: Wpf4 july2010

Cached Compositions

demo

Page 40: Wpf4 july2010

Cached Composition Usage

UIElement.CacheMode = new BitmapCache(); <Rectangle CacheMode="BitmapCache"/>

<Rectangle> <Rectangle.CacheMode>

<BitmapCache EnableClearType="true" RenderAtScale="4" SnapsToDevicePixel="true"/>

</Rectangle.CacheMode> </Rectangle>

Page 41: Wpf4 july2010

Easing Functions for Animations

Basic discrete, linear, spline animationsA Dozen Easing Functions for creating fluid animated behaviors Built-in (circular, exponential, elastic, and bouncy animation progress) and Extensible (custom easing functions) Behaviors!

Page 42: Wpf4 july2010

Easing Functions for Animations

demo

Page 43: Wpf4 july2010

WPF Tooling Improvements

RAD Databinding Easier Auto Layout Markup Extension

IntelliSense More/Easier Prop.

Editors Easier App Styling Silverlight Just Works Less XAML Editing

Visual Studio Designer

Expression Blend 3

Improvements to XAML authoring and workflow

VSM XAML IntelliSense Behaviors Transition

Animations Prototyping Tools

Page 44: Wpf4 july2010

Large Scale WPF Apps @ Microsoft: Visual Studio 2010 + WPF 4

EditorUI

Why and how Microsoft Visual Studio 2010 was built with

WPF 4

- http://microsoftpdc.com/Sessions/CL09 - http://tinyurl.com/yeazt9b

Expression Blend

Expression Web

Page 45: Wpf4 july2010

WPF Apps @ Microsoft

Expression Design and Encoder Deep Zoom ComposerEnterprise Library 5.0SemblioMicrosoft PivotSQL StreamInsight DebuggerMicrosoft SurfacePowerShell ISEMicrosoft Test & Lab Manager (for VSTS)Active Directory Administrative Center

Page 46: Wpf4 july2010

Just tried VS2010 RC. One word incredible. Super fast, great build with things I saw in earlier releases fixed. So awesome.

#VS2010add reference dialog is much faster! Can I get a AMEN?

VS 2010 RC performance is ridiculously faster, can't wait to switch over full time!

VS2010 RC is fast, I wonder what happens when they hit RTM, it'll be like a cheetah, should be called VS Cheetah!!!

#vs2010 is fast like ambulances flying through a school zone at 120 mph being chased by ninjas. and the ninjas are on fire!

The developers on the Visual Studio 2010 RC must have had their usual beverages replaced with unicorn tears or something

#Feedback: Performance!

Page 47: Wpf4 july2010

“Definitely a MASSIVE improvement since VS2010Beta2… So much better than the beta2 that it's hard to know where to start… GREAT WORK GUYS.”

“This release works much faster and is more responsive than VS 2008.”

“I was concerned about the time that particularly xaml files were taking to load - this is now way better.”

“My impression of XAML editor performance seemed better – particularly in the designer.”

“IntelliSense seems to be faster/snappier than VS2008 – great job!”

“Add References was fast!  :)

“I’ve used the latest build over RDP and on my tablet, and I am very happy with the state of VS2010.”

“Involving partners and [the] community to take feedback is a good strategy!”

More #Feedback

Page 48: Wpf4 july2010

WPF 4 Improvements for VS 2010

Text StackWPF 4 Now Use DirectWrite for much improved text clarity

WPF 4 English Text is faster (~10%) compare to WPF 3.5 SP1

Improved JPN MS Gothic Font perf (the VS10 JPN default)

UIAutomation Improvements significantly improve Visual Studio performance on tablets and touch-enabled PCs

GraphicsNew API To Allow Editor Line-scroll to be significantly more efficient over RDP and update less area.

Improve Reliability On VMs. Added API to allow WPF apps to force SW rendering per process enabling Visual Studio 2010 to use SW rendering

Page 49: Wpf4 july2010

WPF 4 Improvements for VS 2010XAML

WPF Designer Template Parsing now ~2x faster

MEF VS & Editor Extensions use XAML catalog for better perf

WPF Designer and Blend share same XamlDom -> ObjectGraph code

MSBuild Uses XAML to parse build properties files

Tree ServicesImproved Focus Management

ExclusiveMenuMode enable better management of keyboard focus between WPF and interop components in MenuMode

RestoreFocusMode allow VS full control over focus restoration amongst interop components

Performance: Use cached copy of DispatcherSynchronizationContext to improve Editor Scroll scenarios (~25%+ gain)

Page 50: Wpf4 july2010

Controls

Now in WPF 4DataGrid, DatePickerVSM

Controls ToolkitChart ControlsThemesRibbonMore coming after RTM…

3.5 SP1More at http://wpf.codeplex.com

Page 51: Wpf4 july2010

Please submit session feedback – we read every one

Vote: Let your voice be heard on WPF futures/featureshttp://dotnet.uservoice.com/forums/40583-wpf-feature-suggestions

Read Scott Guthrie’s blog post on WPF 4http://weblogs.asp.net/scottgu/archive/2009/10/26/wpf-4-vs-2010-and-net-4-0-series.aspx

Series of short “how-to” videos introducing What’s New in Windows Presentation Foundation 4http://www.msdev.com/Directory/SeriesDescription.aspx?CourseId=147

Take advantage of crisp text and layout roundinghttp://blogs.msdn.com/text/

Deploy WPF apps faster with .NET 4 Client Profilehttp://blogs.msdn.com/jgoldb/archive/2009/05/27/net-framework-4-client-profile-introduction.aspx

Related Resources

Page 53: Wpf4 july2010

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