Rati_Ge
Rati_Ge

Reputation: 1270

ResourceDictionary Merge behaviour

In my project I am trying to embed source code from Avalon Wizard but there is something strange happening and I am not able to successful integrate it.

I have the following structure in my Custom control library

Inside my Generic.xaml I have the following delcaration

<ResourceDictionary xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation" xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml">
<ResourceDictionary.MergedDictionaries>
    <ResourceDictionary Source="CuratioCMS.Client.UI;Component/Wizard/Themes/Generic.xaml" />
</ResourceDictionary.MergedDictionaries>

and inside Wizard/Themes/Generic.xaml here is how I have my MergedDictionaries defined

    <ResourceDictionary.MergedDictionaries>
    <ResourceDictionary Source="CuratioCMS.Client.UI;Component/Wizard/Themes/Wizard97.xaml" />
    <ResourceDictionary Source="CuratioCMS.Client.UI;Component/Wizard/Themes/WizardAero.xaml" />
    <ResourceDictionary Source="CuratioCMS.Client.UI;Component/Wizard/Themes/AeroWizardHeader.xaml" />
</ResourceDictionary.MergedDictionaries>

According to Avalon implementation there is one more MergedDictionary provided inside Aero.NormalColor.xaml which looks like this

    <ResourceDictionary.MergedDictionaries>
    <ResourceDictionary Source="CuratioCMS.Client.UI;Component/Wizard/Themes/AeroWizardHeader.xaml" />
</ResourceDictionary.MergedDictionaries>

My problem is that I am not able to use my own class library in my project as designer throws exception which is: Cannot locate resource 'wizard/themes/curatiocms.client.ui;component/wizard/themes/wizard97.xaml'.

If I change Path inside Wizard/Theme/Generic.xaml then error goes away but Wizard is not able to provide Aero functionality and even designer does not work ex expected.

Let me also say, that I decided to have this kind of architecture because according to extended WPF toolkit this is very clean way .

can anyone help me with this?

Upvotes: 0

Views: 737

Answers (1)

Alex Wiese
Alex Wiese

Reputation: 8370

Have you tried using the full pack URI syntax?

Have you tried changing 'Component' to 'component'? Also make sure the dictionary has it's build action set to Resource and you are correctly referencing your CuratioCMS.Client.UI assembly.

Upvotes: 1

Related Questions