Reputation: 10608
The window _splash
is created on a different thread.
MainWindow.WindowStartupLocation = WindowStartupLocation.CenterOwner;
MainWindow.Owner = _splash; // Throw: The calling thread cannot access this object because a different thread owns it
How can I make this code work ?
Upvotes: 2
Views: 1034
Reputation: 5776
BackgroundWorker
s or something like ReactiveExtensions to make this easy.Window
instances on the UI thread.Upvotes: 0
Reputation: 51359
Not to sound crass, but you fix it by running the splash screen on the UI thread running the main window. Why does the splash screen need its own thread?
Upvotes: 1