DaftHacker DaftHacker - 1 year ago 91
C# Question

WPF opening a new window from an event

I'm trying to open a new window inside an event once it is triggered and im receiving: The calling thread must be STA, because many UI components require this.

Can anyone help me out ?

Answer Source

Try to invoke your code from the dispatcher:


//your code

Recommended from our users: Dynamic Network Monitoring from WhatsUp Gold from IPSwitch. Free Download