I'm trying to add reference to resource library defined in another project (e.g Elysium) and use it in expression blend.
Here's how i merge 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 can't seem to get any of the brushes resource defined in those libraries at Expression Blend 4. Any idea?
You can reference a resource throughout an app or from any XAML page within it. You can define your resources using a ResourceDictionary element from the Windows Runtime XAML. Then, you can reference your resources by using a StaticResource markup extension or ThemeResource markup extension.
A resource dictionary is a repository for XAML resources, such as styles, that your app uses. You define the resources in XAML and can then retrieve them in XAML using the {StaticResource} markup extension and {ThemeResource} markup extension s. You can also access resources with code, but that is less common.
A ResourceDictionary is a repository for resources that are used by a Xamarin. Forms application. Typical resources that are stored in a ResourceDictionary include styles, control templates, data templates, colors, and converters.
Found my answer on Expression Blend Forum: http://social.msdn.microsoft.com/Forums/en/blend/thread/21bdc8a1-4a58-49f9-ae4d-c736b8fd673a
"Project > Link To Existing Item > (Navigate to the external Resource Dictionary, select it and click ok.) Rebuild."
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 this:
As a sample I created a new WPF project in Blend and added a control library. I referenced the assembly from the main project.
I added a resource dictionary with one brush, RedBrush.
Than I went to MainWindow.xaml and opened the Resources Panel. There I linked the dictionary.
After linking it shows up in list of resources.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With