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 value 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.



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.

Need Your Help

datetime insertion in SQLite database using QT and parameters

c++ sqlite qt parameters

I am trying to perform an insertion into a SQLite database from a c++/QT application.

About UNIX Resources Network

Original, collect and organize Developers related documents, information and materials, contains jQuery, Html, CSS, MySQL, .NET, ASP.NET, SQL, objective-c, iPhone, Ruby on Rails, C, SQL Server, Ruby, Arrays, Regex, ASP.NET MVC, WPF, XML, Ajax, DataBase, and so on.