private void CancelClose()
{
_dialogResult = null; //when the close is cancelled, DialogResult should be null
_ignorePropertyChanged = true;
WindowState = WindowState.Open; //now reset the window state to open because the close was cancelled
_ignorePropertyChanged = false;
}