Is there a way to "Hide" a dock window instead of closing/recreating....

Docking/MDI for WPF Forum

Posted 10 years ago by Jack Stephenson
Version: 14.1.0601
Avatar

I have a list of objects in a tree view.

All of them require WIndowA.

Some of them also require WindowB

I have bound the selected item from the treeview to Windowa and WindowB.

So when I navigate the the treeview the contents of the windows automatically synch.

Having said that I dont want WIndowB to show up if it is not required for the selected Item.

I have tried changing its visibility (though binding), but the window still shows up in  the menu for the dock.

Is there a solution to this?

Short of closing and re-instantiating WIndowB programatically at runtime.

Is there a solution that can be driven via data-binding to a view model?

---

Thanks

JES

Comments (3)

Posted 10 years ago by Actipro Software Support - Cleveland, OH, USA
Avatar

Hi Jack,

If you are using tool windows, calling Close() on them will keep them alive and associated with the DockManager but effectively in a hidden state where they aren't part of the layout.  Opening them again will put them back in the layout.

Document windows on the other hand also Destroy() by default when they are closed.  This dissociates them from the DockSite too.  You can change that behavior via an option though.

Anyhow, I would think that if you used tool windows, you wouldn't have problems when closing them since the tool windows are still alive.

As a side note, you should never alter a docking window's Visibility yourself since as you saw, that will introduce issues.  Always use our API instead.


Actipro Software Support

Posted 10 years ago by Jack Stephenson
Avatar

As it turns out I need to do this for both ToolWIndows and DocumentWindows

YOu answer for ToolWIndows sounds spot-on.

Vis-avis DocumentWindows please elaborate on your statement  "You can change that behavior via an option though." What do I need to do?

Posted 10 years ago by Actipro Software Support - Cleveland, OH, USA
Avatar

Hi Jack,

Check out the "Lifecycle and Docking Management" topic in the Docking/MDI documentation.  It talks about how to change that option.


Actipro Software Support

The latest build of this product (v24.1.1) was released 1 month ago, which was after the last post in this thread.

Add Comment

Please log in to a validated account to post comments.