Best practice: Create custom control or implement using behaviors?
wpf, wpf-4.0, wpf-controls
Solution
If you are a designer that work in Blend you can easily mix and match behaviors. A custom control can of course also be used in Blend but only the properties and styling can be modified by the designer.
As far as I know behaviors were developed by the Blend team to better facilitate "development" by a non-developer.
So behaviors have some advantages when working in Blend.
Problem
With the current features of WPF, a lot of custom functionality that I would generally default to implementing in a custom control, can just as easily be handled by behaviors and attached properties. For example a `TextBox` with a watermark could be handled by a `Behavior` that adds a 'WatermarkText' attached property and sets a custom `VisualState`. Can anyone elucidate best practices, performance concerns, or criteria for when to implement additional functionality as a `Behavior` versus in a custom control? The obvious is when the `Behavior` could be applied to multiple controls. But in the spirit of code reuse, wouldn't it be better to always have the option of reusing the bahaviour? Even if only for derived controls.