This is the problem. Where could be wrong?
Yes, there is simply nothing to describe in essence, but
private void Window_Closing(object sender, System.ComponentModel.CancelEventArgs e) { e.Cancel = true; }
Called when the window closes, should prevent closure.