private void Window_Closing(object sender, System.ComponentModel.CancelEventArgs e) { if (_imageFrame == null) { return; } _imageFrame.CloseImage(); }