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

Exception when TopMost is set in a child window

Open zerodev1200 opened this issue 3 years ago • 1 comments

Describe the bug

If the child window is set to TopMost and the main window is closed with the child window open, an exception is raised.

Steps to reproduce

1.Open the main window and press [OpenChildWindow]. 2.main window active and close it. 3.An exception will occur. https://github.com/zerodev1200/MetroTopMostIssueSample

Tip: If you delete Topmost="True" in SubWindow.xaml(child window), the exception will not occur.

Expected behavior

The window should close without raising an exception.

Actual behavior

System.ArgumentException: 'E_INVALIDARG'

Environment

MahApps.Metro version: v2.4.9
Windows build number: Win10 21H2
Visual Studio: 2022 17.0.5
Target Framework: .Net 6 

Screenshots

MetroException

zerodev1200 avatar Jan 23 '22 15:01 zerodev1200

Can't reproduce this on Windows 11. Could you attach the full stacktrace? Or try the MahApps.Metro version from https://github.com/batzen/MahApps.Metro/tree/features/ControlzEx6 that version uses the next ControlzEx version 6.0 which should not expose that kind of issues. At least we hope so.

batzen avatar Apr 17 '22 16:04 batzen

This is fixed in latest source with latest ControlzEx pre version.

punker76 avatar Feb 05 '23 14:02 punker76