WPF (in fact all Windows GUI interactions) must have any GUI interaction on a single GUI thread, because the GDI (the subsystem which deals with the GUI in Windows) is single threaded. Everything must be on that thread. That thread is also an STA thread.
You're changing container, setting it's Content, and you're doing it on the wrong thread. There are ways to get it to the right thread.
In the constructor or after calling InitializeComponents(), add this
this.guiContext = SynchronizationContext.Current;
..where guiContext is of type System.Threading.SynchronizationContext. You can then despatch work onto the GUI thread:
guiContext.Send(this.OnGuiThread, temp);
Where OnGuiThread is a method taking as object parameter and temp is the object sent to it.
This will mean re-organising your code, as not only do you have to create GUI objects (like "set" in your code) on the thread, you can only change them on that thread.
Cheers -