Design-Time Dictionary

In my current VSTO project I need a design-time only resource dictionary. I found the following solution and modified it just a bit.

I had some problems with the DesignMode detection in that sample so I used the version here…


public class ResourceDictionary : System.Windows.ResourceDictionary
/// <summary>
/// Gets or sets the uniform resource identifier (URI) to load resources from.
/// </summary>
/// <returns>The source location of an external resource dictionary. </returns>
public new Uri Source
if (Util.DesignMode)
return base.Source;
return null;

if (Util.DesignMode)
base.Source = value;


Leave a Reply

Fill in your details below or click an icon to log in: Logo

You are commenting using your account. Log Out /  Change )

Google+ photo

You are commenting using your Google+ account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )


Connecting to %s

%d bloggers like this: