Binding Resource to DependencyProperty
I am building a CustomControl that must unfortunately contain a poorly built sub-control to which I have neither the code, nor the ability to re-template (internal yada, yada). I do however have access to change its resources, which leaves me with the following question:
If I want to expose a dependencyProperty on my new CustomControl that changes the v开发者_如何转开发alue of a resource (Brush), is it better to make a PropertyChangedCallback that sets the resource explicitly, or to create a binding to the DP and set the resource to the binding.
I'm sure it doesn't make a huge difference in performance, but what is the 'right' way to go?
Thank you kindly.
@ach:-
Right now your requirement is to change Brush and may be in future you may need to do othere thing on that, so it will be better to make a PropertyChangedCallback that sets the resource and will do other stuff.
精彩评论