How do you tell if a WPF Window is closed?
Hope this is useful for you:
PresentationSource.FromVisual(window) == null;
According to this conversation on the MSDN WPF forums (see the last post), you can check to see if the IsLoaded is false, which means that the window is "eligible" for unloading its content. I hope that works for you!
If you derive from the Window class, you can do this:
public bool IsClosed { get; private set; }
protected override void OnClosed(EventArgs e)
{
base.OnClosed(e);
IsClosed = true;
}
It has an advantage over registering for the Closed event - no need to un-register the callback.