-
-
Notifications
You must be signed in to change notification settings - Fork 2.4k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Stuck when launching MetroWindow in a Separate Thread #3944
Comments
@fengxingdy Can you create a simple sample with your issue? Thx And keep in mind, if you create windows in different threads that you need to add all necessary resources to this windows. |
@punker76 Thx. I'll try to create a simple sample to check my issue. By the way, this issue was occured when I update MahApps.Metro from v1.6.5 to v2.2.0, the code works well with v1.6.5 does not work with v2.2.0. |
WinodwLauncher-v2.x.zip |
That's a bug in MahApps.Metro. |
Discovered while fixing MahApps/MahApps.Metro#3944
(GH-3944) Use BeginInvoke to prevent deadlocks in multithreaded cases
@batzen You mean this?
|
Exactly. Fixed that already. We just have to release a new version of ControlzEx. |
I will close this here for now, the final fix will be available with the next release of ControlzEx. |
Describe the bug
This is the code with problem.
SplashThread = new Thread(new ParameterizedThreadStart((state) =>
{
var wnd = new MetroWindow();
wnd.Show();
Dispatcher.Run();
}));
SplashThread.SetApartmentState(ApartmentState.STA);
SplashThread.IsBackground = true;
SplashThread.Start();
Steps to reproduce
Expected behavior
Show a window before main window shown.
Actual behavior
Program stuck in line wnd.Show().if I modify the code like this, use Window instead of MetroWindow.
SplashThread = new Thread(new ParameterizedThreadStart((state) =>
{
var wnd = new Window();
wnd.Show();
Dispatcher.Run();
}));
The window show normally. Is there anything I do wrong?
Environment
Screenshots
The text was updated successfully, but these errors were encountered: