Welcome to MSDN Blogs Sign in | Join | Help

Merged resource dictionaries

One of my favorite new features in the September CTP is merged dictionaries -- you can use these to put resources in a separate file from the rest of your xaml.  Nathan gives a great overview of this feature in http://www.designerslove.net/2005/09/resourcedictionaries-use-em.html.

Published Wednesday, September 28, 2005 10:40 PM by nkramer

Comments

Friday, October 14, 2005 4:34 PM by Keith Patrick

# re: Merged resource dictionaries

Something he left off there (I can't post on his blog) is that the merging can also occur across assemblies. The documentation shows a brief example in a note about September changes, but doesn't elaborate much on it, but basically, so long as you format it like so:
<ResourceDictionary Source="<assembly>;component/<path>/MyResourceDictionary.xaml"/>
It'll merge in. Only catch: right now, you can't refer to a style by name within the external RD (so you can store a base style and derive off it in the same external assembly); subclassing across the assemblies or all in the local one do work, though. The prob is that the {StaticResource ...} gets resolved to an System.Object rather than a System.Windows.Style.
New Comments to this post are disabled
 
Page view tracker