Using Merged Resource Dictionaries in Silverlight 3 to split resources into separate files


Merged Resource Dictionaries provide a way to define and split resources into separate files. By locating application resources in external file we can then reuse them between applications. This feature can be helpful in custom control development, but not only.

In Silverlight 2 resources cannot be factored into separate files and that leads to large App.xaml file holding application-wide shared resources.

Merged Resources Dictionaries are a great solution for these problems – you are free to split style definitions and other resources into manageable pieces, making it easy to localize and revise.

You can include your resource .xaml file in the project as Resource or as Content or as an external assembly.

image

You can refer it like the external xaml like this:

image

And use it like this: {StaticResource TitleBrush}

 

Merged Resource Dictionaries in Silverlight 3

Advertisements

Leave a Reply

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

WordPress.com Logo

You are commenting using your WordPress.com 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 )

Google+ photo

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

Connecting to %s