I've been unable to make this work because of what I believe is a glitch in Visual Studio, so I'd really appreciate if someone could attempt this situation and share what happens.
I have setup in a solution 2 projects: - a C++ application which has been CLI enabled (.exe) - a C#/WPF class library which has a .xaml form inside with a matching .cs window class (.dll)
I want to spawn the WPF window inside my C++ application, so I import its reference and create a new instance of the window and run under a new application context. Thats works fine.
I now want to make classes out of this window and handle different events inherited from protected functions in the C# window, so In the C++ assembly make a public ref class whom child is the .cs class of the .xaml powered window. This compiles fine.
ie:
public ref class myCPPWindow : myWPFWindow { ... };
I then change the window I spawn to the parent class which is located in the C++ assembly rather than the base class located in the C# assembly. Now I get an error on the InitializeComponent() part of the base C# class while loading the .xaml window that I require saying that it fails to load the .xaml window source from the C# assembly even though the base class works. Can anyone give an explanation/fix for this?