I need to create a form in another thread and save it until the user performs some action in the main thread (click the button).
This is not very difficult to do using
System.Windows.Forms.Application.Run(new ApplicationContext());
which starts the application message loop in the current thread. But this solution requires the use of the System.Windows.Forms namespace, which is not a wpf namespace.
Do you know the wpf way to achieve this? =)
PS without starting the application message loop, the thread will be finely terminated after processing the last expression in it. So, the form will appear only for a moment and will be closed. = (
source
share