Window.Close() does not close owned windows
- Dominant language
- C#
- Stars
- 7.7k
- Forks
- 1.3k
- Avg merge
- 1d 11h
- Merged PRs (30d)
- 61
Description
* .NET Core Version: 6.0
* Windows version: 20H2
* Does the bug reproduce also in WPF for .NET Framework 4.8?: Yes
* Is this bug related specifically to tooling in Visual Studio (e.g. XAML Designer, Code editing, etc...)? No
**Problem description:**
Window.Close() closes non-owned windows as documented.
See:
https://docs.microsoft.com/en-us/dotnet/api/system.windows.window.close?view=windowsdesktop-6.0
_Closing a Window causes any windows that it owns to be closed_
**Actual behavior:**
- ShowDialog() not returns on Close().
- ShowDialog() returns on MainWindow close.
**Expected behavior:**
- Owned windows are closed as documented.
- ShowDialog() returns.
**Minimal repro:**
[WindowCloseBug.zip](https://github.com/dotnet/wpf/files/9053163/WindowCloseBug.zip)
Contributor guide
Assessment
This issue has not been assessed yet.