Embedd WPF window / control WPF application from another AppDomain application

I have an assembly that generates a form (this is client software). I can create an application to create and run (Show), without any problems. But I cannot start this form twice, because assembly does not provide a clear capsule solution. Every second start it would crash, because several things would not be initialized successfully the second time. Unfortunately, this assembly cannot be changed.

Now I put this in a separate AppDomain to be able to unload this assembly. This works great, and the hosting application can now run this form several times.

Now the problem : I have a WPF application that should not show this Form assembly, it should contain it in one of its windows. The WinForms build form is already in the WindowsFormHost and WPF window (with AssemblyAppDomain). But I cannot designate WPF-Window as the Content of one of the main WPF-app windows. It is in the AssemblyAppDomain AppDomain (and the object space is not shared with it).

As far as I was looking, it should be possible to establish a connection between two WPF windows in different AppDomains, because this is similar to how System.AddIn works. Should work with Pipeline, Contract and FrameworkElementAdapter. I'm a little stuck and more specific hints will be understood!

0
source share
1 answer

WPF? .

+2

All Articles