When I have a ViewModel as the DataContext for a ToolWindow how can I tell when the ToolWindow becomes visible (visibility changed)? The ToolWindow has an IsOpen Boolean property and by using an attached behavior I can add an IsActive but these two properties are not enough to let the ViewModel know all the states. A ToolWindow can be open but not active or visible because there could be other ToolWindows in the same container and only one can be visible at one time. Also just because the ToolWindow is visible does not mean its active.
So how can my ViewModel know when the visibility of its ToolWindow changes?