1 post in this topic

So I've been at this since last night. I just want to have a custom solidbrush defined in a resource dictionary and then have all of my custom controls be able to see it. so I've tried using C# code and I've tried using the generic.xaml file. No matter what way I do it, I can see the resource dictionary during the construction of the control (if I use code behind), then I can't see it during the time it's being applied (resources shows up as having 0 keys/values).

generic.xaml:

<ResourceDictionary.MergedDictionaries>

<ResourceDictionary Source="ms-appx:///Test.CustomControls.Test/Themes/Styles.xaml" />

</ResourceDictionary.MergedDictionaries>

The generic.xaml compiles fine and does not complain at not being able to find that resource. Why can't my controls see it? I have a solid brush keyed as MActiveColorBrush.

EDIT: If I put it directly into the top elements resources then it works. But I would like to have a one line piece that then embeds the resource dictionary in every control of generic.xaml. Can this not be done? If not why does it let you designate merged dictionaries at the root level of the generic.xaml?

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!


Register a new account

Sign in

Already have an account? Sign in here.


Sign In Now
Sign in to follow this  
Followers 0

  • Recently Browsing   0 members

    No registered users viewing this page.