Developers coming from the WPF world missed a very important feature in Silverlight. It was the ability to bind directly to UI elements. This was creating simple master-details scenario was impossible unless introducing extra properties between the UI element. (Maybe in the ViewModel for example)
Starting from Silverlight 3.0 Element to Element binding is supported so now WPF developers can be satisfied. 🙂 Here is a very simple demonstrative sample.
In the previous example we bind the Slider’s Value property to the rectangle’s Effect.ShadowDepth property. (ElementName determines the UI element, while Path deteremines the specified property). The result should be the following:
Changing the values on the slider is immediately reflected by the DropShadowEffect because of the binding defined earlier.
As you can see it this is a very easily applicable but also a very important feature. Just imagine that we bind a DataForm’s CurrentItem property to a DataGrid’s SelectedItem property which would be a very simple and effective support for Master-Detail scenarios.
The sample Demo project can be downloaded here: