15.5. Binding Changes

Besides the very welcome new Binding window in VS2010, there are a number of other changes in the exciting world of binding.

15.5.1. Run.text

Run.text is now a dependency property, which means you can now bind to it (one way) unlike previous releases of WPF.

15.5.2. Dynamic Binding Support

WPF 4.0 supports binding to properties implementing the IDynamicMetaObjectProvider interface such as ExpandoObject and anything inheriting from DynamicObject (see Chapter 3).

15.5.3. Input Bindings Now Support Bindings

In previous releases of WPF, it was quite tricky to set binding to input keys using the InputBinding class. This was because the Command property was not a dependency property and also didn't inherit the parent's data context. This could make certain scenarios such as implementing the MVVM pattern difficult.

This is resolved in WPF 4.0. InputBinding, MouseBinding, and KeyBinding now inherit from Freezable, and various related properties are now made dependency properties. This should then allow you to write input binding XAML such as the following:

<Window.InputBindings>
<KeyBinding
Modifiers="Control" Key="L"
Command="{Binding MyCustomCommand}" />
</Window.InputBindings>

..................Content has been hidden....................

You can't read the all page of ebook, please click here login for view all page.
Reset
18.218.171.212