0

My Solution consists of the following projects:

  • ServiceTools.Com
  • ServiceTools.UI (Startup)
  • ServiceTools.UI.Controls
  • ServiceTools.UI.Themes

In UI.Controls I've created a custom Button Control which derives from Button. This Custom button should use a ResourceDictionary which is located in ServiceTools.UI.Themes.Buttons.Default.xaml

So ServiceTools.UI.Controls references ServiceTools.UI.Themes and uses

<ResourceDictionary>
        <ResourceDictionary.MergedDictionaries>
            <ResourceDictionary Source="pack://application:,,,/ServiceTools.UI.Themes;component/Buttons/Default.xaml" />
        </ResourceDictionary.MergedDictionaries>
</ResourceDictionary>

If I try to use the Dictionary IntelliSense is suggesting all my Brushes (at least outside the Triggers section). When I start debugging the application it crashes immediately with a System.Windows.Markup.XamlParseException (

Inner Exception: Could not load file or assembly 'ServiceTools.UI.Themes, Culture=neutral' or one of its dependencies. The system cannot find the file specified.":"ServiceTools.UI.Themes, Culture=neutral"

May anyone tell me why this is not working as expected?

Edit 1:

For test purpose I added a new ResourceDictionary inside ServiceTools.UI.Controls and referenced it as:

[...] Source="pack://application:,,,/Themes/Default.xaml"[...]

but with the same result - Exception that says "cannot locate resource".

Th1sD0t
  • 1,089
  • 3
  • 11
  • 37

0 Answers0