2

I have a Solution with multiple Projects in it. One of them is a Common Project that all other Project have a reference to. In this, I defined some WPF styles and converter and such. I use theese styles from a diffrent Project like this:

<ResourceDictionary.MergedDictionaries>
    <ResourceDictionary Source="pack://application:,,,/CommonDriverInterface;component/Style/Style.xaml" />
</ResourceDictionary.MergedDictionaries>

This works fine and i can use Styles from all diffrent Projekts without Problems.

What I want now is that one of my Projects, lets say Project X, loads those resources when Building, so that the X.dll that is resulting of this Project works on is own with the styles that it gets from the Common Project. I use the X.dll on its own with a diffrent script, and also open a Window there, but when it tries to open the window the application crashes at this line:

   <ResourceDictionary Source="pack://application:,,,/ABUToolsCommonDriverInterface;component/Style/ABUToolsStyle.xaml" />

Because that is a reference to a diffrent Project, not within the X.dll I think loading the Resources when Building should solve my Problem, but I am not sure how to load it when Building so that the X.dll contains the styles.

Edit: The Project X has no App.xaml in it

Bedi
  • 55
  • 6
  • "one of my Projects loads those resources when Building". That project should be the consuming app. Did you reference all assemblies from it? – mm8 Aug 22 '18 at 09:42
  • Possible duplicate of [ResourceDictionary in a separate assembly](https://stackoverflow.com/questions/338056/resourcedictionary-in-a-separate-assembly) – aydjay Aug 22 '18 at 09:43
  • @mm8 i have a reference to the Common Project in it. This also works fine when Start from the main application, with every Project loaded. But when i try to use one of the .DLL standalone, i cant open WPF Windows from there. – Bedi Aug 22 '18 at 09:52
  • I have a vbs script that runs a method from the .DLL, this method opens a window. This works fine when i dont use any styles in the Window. But when i refrence the Resources from a diffrent Project, the script crashes. – Bedi Aug 22 '18 at 10:02
  • @d347hm4n unfortunatly this doesnt help me. – Bedi Aug 22 '18 at 10:03

0 Answers0