- 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
-
Microsoft quietly adds Windows UCPD driver to block Registry hacks for default app switches
By hellowalkman,
- microsoft
- windows 11
- (and 17 more)
- 16 replies
- 4 views
-
Statcounter: Windows 11 market share falls to 26.72% 1 2
By TarasBuria,
- statcounter
- statcounter march 2024
- (and 6 more)
- 27 replies
- 1 view
-
Epic Games Store will end Windows 7, 8, 8,1, and 32-bit Windows 10 support in June 2024
By TarasBuria,
- epic games store
- windows 10
- (and 4 more)
- 13 replies
- 3 views
-
Nvidia releases new drivers for unsupported graphics cards and Windows versions
By TarasBuria,
- nvidia
- nvidia 474.89
- (and 9 more)
- 4 replies
- 1 view
-
- 36 replies
- 5 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
Share on other sites
0 answers to this question
Recommended Posts