How to override default window close operation?
This page should help.
Closing can be handled to detect when a window is being closed (for example, when Close is called). Furthermore, Closing can be used to prevent a window from closing. To prevent a window from closing, you can set the Cancel property of the CancelEventArgs argument to true.
And
If you want to show and hide a window multiple times during the lifetime of an application, and you don't want to reinstantiate the window each time you show it, you can handle the Closing event, cancel it, and call the Hide method. Then, you can call Show on the same instance to reopen it.
Try overriding OnClosing in Window.xaml.cs
private override void OnClosing( object sender, CancelEventArgs e )
{
e.Cancel = true;
//Do whatever you want here..
}