We are trying to integrate existing WPF window on to Win32 container application. The win32 application can integrate and show only Winforms Usercontrols.
Since we already have a running WPF window code, we used the element host and we used the content presenter of the window inside the element host to show

as a winforms usercontrol.The WPF window code overrides the function protected virtual void OnInitialized(EventArgs e) and calls first base.OnInitialized and then

the custom code. The issue is here is that you can run the below code for the first instance from win32 container , but second instance when we execute same

code , it throws the error "The calling thread cannot access this object because a different thread owns it." from the line base.OnInitialized when initialization

AutoUpdate window = new Autoupdate();
Even if we use the below code under dispatcher it throws the same error after the firstime.

ElementHost elementHost = new ElementHost();
elementHost.Dock = DockStyle.None;
elementHost.Width = 150;
elementHost.Height = 50;

AutoUpdate window = new Autoupdate();
ContentPresenter pres = new ContentPresenter();
pres.Content = window.Content;

elementHost.Child = pres;
this.Controls.Add(elementHost);