MahApps.Metro icon indicating copy to clipboard operation
MahApps.Metro copied to clipboard

ShowModalMessageExternal problem with PowerShell

Open SirConfigMgr opened this issue 5 years ago • 2 comments

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.

  1. Klick button
  2. Dialog should be displayed
  3. 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)

SirConfigMgr avatar May 05 '21 11:05 SirConfigMgr

Still having this issue in version 2.4.9 and with PowerShell 7.0.

pschwab1 avatar Dec 28 '21 20:12 pschwab1

I'm having this issue to, oddly only when run via the powershell ISE though.

KG-droid avatar Jan 14 '22 16:01 KG-droid