- 0
[C#] Custom control not seeing dictionaries even though in the debugger I c
-
Recently Browsing 0 members
- No registered users viewing this page.
-
Similar Content
-
- 29 replies
- 0 views
-
Windows 11 vs 10 vs 8.1? Users overwhelmingly feel Microsoft's modern OS is worst for old PC 1 2 3
By hellowalkman,
- 69 replies
- 0 views
-
Microsoft reveals how Windows 10/11 nearly broke PCs from an official cyberthreat song
By hellowalkman,
- microsoft
- windows 11
- (and 9 more)
- 5 replies
- 0 views
-
Microsoft says user feedback alone would have never made modern Windows design as "special" 1 2
By hellowalkman,
- 32 replies
- 0 views
-
Mozilla once again extends Firefox support on Windows 7
By TarasBuria,
- 24 replies
- 0 views
-
Question
sathenzar
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?
Link to comment
https://www.neowin.net/forum/topic/1130502-c-custom-control-not-seeing-dictionaries-even-though-in-the-debugger-i-c/Share on other sites
0 answers to this question
Recommended Posts