Awaiting Asynchronous function inside FormClosing Event

The best answer, in my opinion, is to cancel the Form from closing. Always. Cancel it, display your dialog however you want, and once the user is done with the dialog, programatically close the Form. Here’s what I do: async void Window_Closing(object sender, CancelEventArgs args) { var w = (Window)sender; var h = (ObjectViewModelHost)w.Content; var … Read more