Bienvenue à Blogs CodeS-SourceS Identification | Inscription | Aide

Thomas Lebrun

Tout sur WPF, LINQ, C# et .NET en général !

Actualités

[WPF] Les nouveautés/améliorations apportées par le SP1 de VS 2008 et du Framework .NET 3.5

Maintenant que le SP1 est en bonne voie, on peut commencer à voir les différentes améliorations apportées à tout ce qui touche à WPF. Ainsi, Brad Adams nous en parle un peu plus et nous permet de savoir que l'on a droit à:

  • Des améliorations de performances pour le texte, les graphics, les animations, etc....
  • Une API sur les effets WPF. Ainsi, il sera possible d'utiliser des effets (profitant de l'accélération matérielle) sur n'importe quelle "shape" (composants) => Il va falloir que je creuse ca à l'occasion
  • Le support de l'onglet "Evènements" dans Cider, le designer WPF de Visual Studio (et oui, c'est tout bête mais cela n'était pas dispo...):

  • Le tri par ordre alphabétique des propriétés:

  • La possibilité de faire, plus simplement, du design de formulaire:

  • Un meilleur debugging XAML, qui vous renvoit directement sur la ligne XAML qui est incorrecte (voila qui va faire gagner pas mal de temps Wink):

  • Un nouveau contrôle: le WebBrowser (dans System.Windows.Controls):

  • Un nouveau "BindingGroup", dans System.Windows.Data

 

De son coté, Scott Guthrie nous livre également une liste des nouveauté/améliorations relatives à WPF:

WPF Performance Improvements

.NET 3.5 SP1 includes several significant performance optimizations and improvements to WPF.  Some of the specific graphics improvements include:

  • Smoother animations
  • Hardware accelerated rendering of Blur and DropShadow Bitmap Effects
  • Text Rendering speed improvements - especially with VisualBrish and 3D scenes
  • 2D graphics improvements - especially with z-index scenarios
  • A new WriteableBitmap class that enables real-time and tear-free bitmap updates.  This enables custom "paint"-style applications, data visualizations, charts and graphs that optionally bypass the default WPF 2D graphics APIs.
  • Layered window performance improvements

SP1 also adds support for better data scalability in WPF.  The ListView, ListBox and TreeView controls now support "item container recycling" and "virtualization" support which allows you to easily achieve a 40% performance improvement with scrolling scenarios.  These controls also now optionally support a "deferred scrolling" feature which allows you to avoid scrolling in real time and instead wait until a user releases the scroll thumb (the default scrolling mode in Outlook). This can be useful when scrolling over very large data sets quickly. 

WPF Data Improvements

.NET 3.5 SP1 includes several data binding and editing improvements to WPF.  These include:

  • StringFormat support within {{ Binding }} expressions to enable easy formatting of bound values
  • New alternating rows support within controls derived from ItemsControl, which makes it easier to set alternating properties on rows (for example: alternating background colors)
  • Better handling and conversion support for null values in editable controls
  • Item-level validation that applies validation rules to an entire bound item
  • MultiSelector support to handle multi-selection and bulk editing scenarios
  • IEditableCollectionView support to interface data controls to data sources and enable editing/adding/removing items in a transactional way
  • Performance improvements when binding to IEnumerable data sources

WPF also now exposes hooks that enable developers to write custom panels w/ virtualized scrolling.  We'll be using this support together with the above data binding improvements to build the new WPF datagrid that will be shipping later this year.

WPF Extensible Shader Effects

.NET 3.5 SP1 adds support in WPF for a new shader effects architecture and API that allows extremely expressive visual effects to be created and applied to any control or element within WPF.  These shader effects support blending multiple input compositions together.  What makes them particularly powerful is that WPF executes effects (including custom effects you build yourself) using the GPU - giving you fully hardware accelerated graphics performance.  Like almost everything in WPF, you can also use WPF databinding and animation on the properties of an effect (allowing them to be fully integrated into an experience).

Applying an effect onto a Control is super easy - just set a Control's "Effect" property.  For example, to add a hardware accelerated drop-shadow effect on a button you can use the built-in <DropShadowEffect> on it via either code or XAML:

Which will cause the button to render like so:

Because Effects are extensible, developers can create their own custom Effect objects and apply them.  For example, a custom "DirectionalBlurEffect" could be created and added to a ListBox control to change its scroll appearance to use a blur effect if you rapidly scroll across it:

Keep an eye on Greg Schechter's blog to learn more about how the Effects architecture works and to learn how you can both create and apply new effects within your applications. 

Note: In addition to introducing the new Shader Effects API, WPF in SP1 also has updated the existing Blur and DropShadow Bitmap effects already in WPF to be hardware accelerated.

WPF Interoperability with Direct3D

.NET 3.5 SP1 adds support to efficiently integrate Direct3D directly into WPF.  This gives you more direct access to the hardware and to take full advantage of the Direct3D API within WPF applications.  You will be able to treat Direct3D content just like an image within an application, as well as use Direct3D content as textures on WPF controls. 

For example, below are three samples from the Direct3D SDK:

We could either load them in as image surfaces within a WPF application, or map them as textures on WPF controls.  Below is an example of mapping them as textures onto cubes in a WPF 3D application:

Note: the Direct3D integration isn't today's SP1 beta release.  It will appear in the final SP1 release.

VS 2008 for WPF Improvements

VS 2008 SP1 includes several significant improvements for WPF projects and the WPF designer.  These include:

  • Several performance improvements
  • Events tab support within the property browser
  • Ability to sort properties alphabetically in the property browser
  • Margin snaplines which makes form layout much quicker
  • Better designer support for TabControl, Expander, and Grid
  • Code initiated refactoring now updates your XAML (including both control declarations and event declarations in XAML)
  • Go to Definition and Find All References now support things declared in XAML

The debugger has also been updated in SP1 so that runtime errors in XAML markup (for example: referencing styles, datasources and/or other objects that don't exist) will now be better identified within the debugger:

Je sens que la fonctionnalité "StringFormat", utilisable lors du binding, va plaire à beaucoup de monde car elle permet de formatter l'affichage lors du binding: plus besoin de passer par un Converter Wink:

Text="{Binding ElementName=slider, Path=Value, StringFormat='Amount: {0:C}'}"

 

Comme vous pouvez le voir, donc, pas mal de nouveautés et encore, je n'ai couvert ici que la partie WPF: il reste ce qui touche au Web, à ClickOnce, aux langages C#/VB.NET, etc.....

 

Pas mal de choses à tester/jouer avec pour vous en dire plus donc !

 

A+

Ce post vous a plu ? Ajoutez le dans vos favoris pour ne pas perdre de temps à le retrouver le jour où vous en aurez besoin :
Posted: mardi 13 mai 2008 01:08 par Thomas LEBRUN
Classé sous : , ,

Commentaires

Pas de commentaires

Les commentaires anonymes sont désactivés

Les 10 derniers blogs postés

- T_PAAMAYIM_NEKUDOTAYIM par MadMatt le il y a 21 heures et 21 minutes

- Et je mets le son.... par Pierrick's Blog le 07-19-2008, 12:09

- SharePoint : Comment interdire l’accès à un utilisateur pour tous les sites d’une Web Application par Blog Technique de Romelard Fabrice le 07-18-2008, 19:05

- VPC - Reset de la position de la console par Blog technique de Nicolas Boonaert le 07-18-2008, 16:29

- Un bug dans IE rendra cette page… non-imprimable ! par Le blog de FremyCompany le 07-18-2008, 15:33

- Quelques retours sur Google Protocol Buffers par Julien Chable le 07-18-2008, 11:10

- SharePoint et le multilinguisme : Comment gérer la traduction des propriétés dans les toolbars des WebParts par The Mit's Blog le 07-18-2008, 10:53

- [Open XML] Les liens de la semaine 14/07/2008 par Julien Chable le 07-18-2008, 10:29

- Une nouvelle version des TFS Power tools est disponible par Michel Perfetti [Miiitch] le 07-18-2008, 09:37

- EF et le testeur fou par Matthieu MEZIL le 07-18-2008, 07:34