I\'m trying to override the onclose event on WPF, this is my code so far:
protected override void OnClosing(System.ComponentModel.CancelEventArgs e) {
You are asking it not to close by setting e.Cancel = true. Just don't do that.
e.Cancel = true
The application never closes because you are setting e.Cancel to true.
e.Cancel
true
Try
protected override void OnClosing(System.ComponentModel.CancelEventArgs e) { //do my stuff before closing base.OnClosing(e); }