How to initialize an attached DependencyProperty of type Collection

I was reading a thread about Commands in the WPF Disciples group and noticed a comment about being unable to initialize an attached property where the type was collection.  The problem was unless you put in an explicit Collection object tag, the property is initialized to null when the XAML parser tries to add to it.  I ran…


Great example of an attached behavior

From Dave Relyea’s blog, Pixel Snapping in Silverlight as an attached behavior: