0 people following this project (follow)

Project Description
A library for Silverlight which attempts to bridge the feature gap of Bindings between Silverlight and WPF. It contains an attached behavior that implements a form of ElementName Binding between two FrameworkElements.

A simple example, which yields a Calendar control that changes opacity when Slider.Value changes.
<e:Calendar ab:AttachedBinding.Binding="TargetProperty=Opacity, ElementName=OpacitySlider, Path=Value"/>
<Slider x:Name="OpacitySlider" Minimum="0" Maximum="1" SmallChange="0.1" LargeChange="0.1" Value="1.0"/>

How it works
AttachedBindings work by placing a Proxy in between both FrameworkElements; a standard TwoWay Binding connects the Target to the proxy and a standard OneWay Binding connects the Source to the Proxy. The Proxy is simply an object which implements INotifyPropertyChanged to notify the target binding that it's changed.

Prior Art
At this time there is one other solution that is using a "ThreeWay" binding approach, Neil Mosafi's SilverStone framework uses an ElementNameBinder control which explicitly acts as the proxy between the desired Target & Source. His solution works well, but I wanted a solution that attempts to emulate WPF Binding syntax and behavior.

Features
  • Uses a custom TypeConverter to extend the XamlParser, allowing a simple string format to be used rather than the extended xaml object notation.
  • Supports many Target binding to a single source (Proxy Reuse)
  • Supports IValueConverter and ConverterParameter
  • Supports failing silently (default) or throwing on error for debugging

Limitations
  • No TwoWay Binding Support. This won’t change any time soon until I can use a better solution than a Proxy Object (Access to FrameworkElement.DependencyPropertyChanged would sure be nice here)
  • Certain “Core” properties (such as ActualWidth/ActualHeight) throw when a TwoWay Binding is set on them.
  • No RelativeSource support yet. Self and FindAncestor modes should be easy to implement, but TemplatedParent is currently not possible.
  • Currently the Path syntax is inflexible. I'd like to add a PropertyPath behavior, finding the leaf property and using that for the source binding.

News
Initial Release Announcement - 9/22/2008
http://www.dragonshed.org/blog/2008/09/22/attachedbindings-for-silverlight/

Last edited Dec 5 2009 at 4:46 AM by dragonshed, version 15