Unloaded event not called on Window when app closed
- Dominant language
- C#
- Stars
- 7.7k
- Forks
- 1.3k
- Avg merge
- 1d 11h
- Merged PRs (30d)
- 61
Description
* .NET Core Version: 3.0.100-preview7-012821
* Windows version: Windows 10 16299
* Does the bug reproduce also in WPF for .NET Framework 4.8?: Yes
**Problem description:**
When window is closed with the close button in the title bar, the `Window.Unloaded` event is not called if this is the last open window of the application. This is inconsistent behavior as the event is normally called for other windows.
**Actual behavior:**
`Window.Unloaded` does not fire
**Expected behavior:**
`Window.Unloaded` should fire.
**Minimal repro:**
```
public partial class MainWindow : Window
{
public MainWindow()
{
InitializeComponent();
this.Unloaded += Debug.WriteLine("Hit");
}
}
```
Contributor guide
Assessment
This issue has not been assessed yet.