question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Stuck when launching MetroWindow in a Separate Thread

See original GitHub issue

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

MahApps.Metro version: v2.2.0
Windows build number: Win10 1909 [Version 10.0.18363.836]
Visual Studio: 2019 16.7.3
Target Framework: v4.7.2

Screenshots

Issue Analytics

  • State:closed
  • Created 3 years ago
  • Comments:7 (3 by maintainers)

github_iconTop GitHub Comments

1reaction
batzencommented, Oct 23, 2020

Exactly. Fixed that already. We just have to release a new version of ControlzEx. I also made the PInvoke-Wrappers we have there appear in the StackTrace again.

0reactions
punker76commented, Oct 24, 2020

I will close this here for now, the final fix will be available with the next release of ControlzEx.

Read more comments on GitHub >

github_iconTop Results From Across the Web

MahApps.Metro window not showing with version 2.2.0 ...
This is started in different thread. However, execution does not happen after I call the Show() function. I mean the window doesn't show....
Read more >
MahApps.Metro v2.3.1 release notes (2020-10-24) | LibHunt
Version Release Notes from October 24, 2020 (over 2 years ago) ... #3944 Stuck when launching MetroWindow in a Separate Thread; #3943 Popup...
Read more >
How to start WPF in separate thread and still updating it ...
I want to have a WPF window that takes data from a BlockingCollection<ColorAddress>(ConcurrentQueue<ColorAddress>) continuously. I have managed ...
Read more >
Stuck in Metro apps screen - Win-key doesn't toggle
Sometimes when I toggle from the classic desktop to the metro desktop using the Win key there is no way for me to...
Read more >
Issue with opening IOS Simulator
Hi, I am developing an App in React Native for this i need Xcode. However when i start my Expo Developer Tool Metro...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found