With the current WPF functions, many of the user-defined functions that I would normally use to implement in a user control can be just as easily handled by behavior and attached properties.
For example, a watermarked TextBox can be processed using Behavior , which adds the attached property βWatermarkTextβ and sets a custom VisualState .
Can someone clarify best practices, performance issues, or criteria in order to implement additional features like Behavior compared to a custom control?
The obvious thing is that Behavior can be applied to multiple controls. But in the spirit of code reuse, isn't it better to always be able to reuse bahaviour? Even if only for derived controls.
source share