.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:
Figure 7
Which will cause the button to render like so:
Figure 8
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:
Figure 9
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 (his first set of posts are here).
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:
Figure 10
We could either load them in as image surfaces within a WPF
application, or map them
Figure 11
Note: the Direct3D integration isn't today's
SP1 beta release. It will appear in the final SP1 release.