title: In wpf, is there a way to execute code before the control is unloaded...? like maybe an unloading event?
body: <p>I need to execute code before a wpf user control is unloaded and cancel the unloading if certain conditions are met and keep the control open in its current state in the ui...</p>
  
  <p>Is there any way I can accomplish this? I couldnt see anything like unloading event?
  Thanks,</p>