Quantcast
Channel: Windows Presentation Foundation (WPF) forum
Viewing all articles
Browse latest Browse all 18858

Setting a property of a usercontrol to a static resource...

$
0
0

I have some functionality in my project that, in the interest of speed, I just cut and pasted to the places I needed it. It's a bit of XAML and code that manages a document list.  Now that I have a bit of time to focus on it, I'd like to encapsulate that bit into a usercontrol that I can drop in and replace the duplicated XAML and code.

One question I have...  The control would have to use different colors for it's primary elements, depending on which area it is being used in.  At the moment, I am just assigning the colors directly to the elements that need it via a static resource I have declared.  How would I expose a property, from the user control, for the primary color to be used?

Do I create the property in the code-behind of the usercontrol and then assign it in the XAML where it's used?  And if so, how do I do that with a static resource?

Thanks.

J


http://digitalcamel.blogspot.com/


Viewing all articles
Browse latest Browse all 18858

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>