So I have two Windows (same app) and one RadGrid in each, I simply want to dragdrop from one the other. But the problem is that I have my windows on separate threads for better UI performance. And therefore get error: "The calling thread cannot access this object because a different thread owns it."
How can I solv this?
I open My windows like this:
How can I solv this?
I open My windows like this:
private void ShowMyWindow1() |
{ |
Thread _Thread = new Thread(() => |
{ |
MyWindow1 _MyWindow1 = new MyWindow1(); |
_MyWindow1.Show(); |
_MyWindow1.Closed += (sender, e) => |
_MyWindow1.Dispatcher.InvokeShutdown(); |
System.Windows.Threading.Dispatcher.Run(); |
}); |
_Thread.Name = "My Window"; |
_Thread.SetApartmentState(ApartmentState.STA); |
_Thread.Start(); |
} |