Interactivity.Behavior<T> vs attached properties

Zim picture Zim · Feb 24, 2010 · Viewed 9.4k times · Source

I'm trying to find some differences between these approaches. Is there any situation where behaviors are used and the same functionality could not be done with attached properties?

Answer

Reed Copsey picture Reed Copsey · Feb 24, 2010

No. Behaviors are basically just a much nicer abstraction on top of attached properties.

By using Behavior<T>, you gain access to the AssociatedObject directly, as well as the ability to attach and detach the behavior, easily, at runtime.

You could do this with attached properties, but it would require adding a lot of extra plumbing.