How Expression Blend Adds a Link to an External Resource Dictionary Defined in a Third-Party Library Topic

I am trying to add a link to a resource library defined in another project (e.g. Elysium) and use it as a blend.

This is how I combined the resource dictionary in my App.Xaml file.

<Application.Resources> <ResourceDictionary> <ResourceDictionary.MergedDictionaries> <ResourceDictionary Source="pack://application:,,,/MahApps.Metro;component/Styles/Controls.xaml" /> <ResourceDictionary Source="pack://application:,,,/MahApps.Metro.Resources;component/Icons.xaml" /> <ResourceDictionary Source="pack://application:,,,/Telerik.Windows.Themes.Metro;component/Themes/System.Windows.xaml" /> </ResourceDictionary.MergedDictionaries> </ResourceDictionary> </Application.Resources> 

But I cannot get any brush resource defined in these libraries in Expression Blend 4. Any idea?

enter image description here

+6
source share
3 answers

Found my answer on the Expression Blend forum: http://social.msdn.microsoft.com/Forums/en/blend/thread/21bdc8a1-4a58-49f9-ae4d-c736b8fd673a

"Project> Link to an existing item> (Go to the external resource dictionary, select it and click OK.) Restructuring."

+4
source

I think the Source property is set incorrectly.

 <Window.Resources> <ResourceDictionary> <ResourceDictionary.MergedDictionaries> <ResourceDictionary Source="/WpfControlLibrary1;component/BrushesInAssembly.xaml"/> </ResourceDictionary.MergedDictionaries> </ResourceDictionary> </Window.Resources> <Grid x:Name="LayoutRoot" Background="{DynamicResource RedBrush}"/> 

What I did to come to the following:

As an example, I created a new WPF project in Blend and added a management library. I referenced the assembly from the main project.

I added a one-brush resource dictionary, RedBrush.

project

Than I went to MainWindow.xaml and opened the resource panel. There I linked the dictionary.

resource pane

After linking, it appears in the list of resources.

Redbrush

+1
source

Hope you found a solution already, but if I do not use this link here as a permalink.

He does the following: shows how to link ResourceLibraries in external resource projects, how to name styles and organize them so that someone on the team knows what is happening, etc. So simple, so great.

Hope this helps someone.

0
source

All Articles