MahApps.Metro
MahApps.Metro copied to clipboard
ShowModalMessageExternal problem with PowerShell
Describe the bug
I´m using Powershell with MahApps to display a GUI for the PS script. After migrating from version 1.6.5 to 2.4.5, the display of dialogs no longer works. I get an exception with
"The calling thread cannot access this object because the object is owned by another thread."
Steps to reproduce
A description of how to trigger this bug.
- Klick button
- Dialog should be displayed
- Powershell crashes
Github repository: https://github.com/SirConfigMgr/InplaceNotification UserInfo.ps1 in Line 459
Expected behavior
Dialog should be displayed
Actual behavior
Powershell crashes
Environment
MahApps.Metro version: v2.4.5
Windows build number: Win10 1909 [Version 10.0.18363.836]
Visual Studio: 2019 16.6.0
Target Framework: .Net Core 3.1 (v4.5.2, v4.7.2)
Still having this issue in version 2.4.9 and with PowerShell 7.0.
I'm having this issue to, oddly only when run via the powershell ISE though.