WPF CustomControl - Resources Property
I have CustomControl deriving from another control in which I set the default st开发者_JS百科yles in its resources property (in xaml). Later, I want to use this CustomControl and add new resources to it by using the default syntax: <my:CustomControl.Resources>...
How can I do this? Currently, I get an error: Cannot re-initialize ResourceDictionary instance.
You have tried with merge?
http://msdn.microsoft.com/en-us/library/aa350178.aspx
[EDIT] The link above isn't working anymore...
This is the right answer:
Merged ResourceDictionary vs App.xaml
There is couple solutions:
Add new resources to parent's resource block.
Add new resources as resource dictionary.
精彩评论