Is it possible to add one resource dictionary into other one?
Share
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
In Dictionary2.xaml define MergedDictionaries (right after the opening ResourceDictionary tag):
there’s a catch: each time you merge dictionaries you effectively create a copy of the merged dictionary. And it’s recursive – if you have Dict3.xaml and Dict4.xaml that both load Dictionary2.xaml, you will have three instances of Dictionary1.xaml created
The solution is a SharedResourceDictionary. The implementation in the tutorial should be seen as a starting point and will probably need some level of tweaking – depending on use scenario. Google “wpf SharedResourceDictionary” for some gotchas and solutions.
From answer to this question by XAMeLi