Your Privacy Matters: We use our own and third-party cookies to improve your experience on our website. By continuing to use the website we understand that you accept their use. Cookie Policy
565
Dock Manager as simple tab control with "popout" tabs
posted

I've been playing with the XAMDockManager to get it to provide a simple tab control with four or five content tabs that can be "popped out" into their own windows that can be positioned (and layout saved).  I'd like to disable any docking ability save the switch between a floating window and a tab item in the control.  If the user pops out a tab item to a floating window the user can "close it" which would dock it back into the original tab control.

The XamDockManager has all the nifty support I need, floating windows, layout persistence tc, but I can't figure out how to do a few things:

(a) disable all docking, don't want split panes or anything else.

(b) hide the close button and the "file menu" displayed in the document content host tab right hand side.

(c) detect that change in state of a content pan from docked in the document content host to being a floating window.  This would help me to toggle the state of the allow close field which would be disabled when a tab, but enabled when a floating window.  when the floating window is closed it would redock the content pane to the document content host

I haven't yet looked at adding the "pop out" icon to the tab.  I expect to be able to style the content pane header to make this happen.

Can someone point me to examples to help with these items?

Thanks.

Parents
  • 34510
    Verified Answer
    Offline posted

    Hi dcg1212,

    If you want to disable any kind of docking then you can set the AllowDocking property on the ContentPane.  This won't let users drag the panes out though.  In order to accomplish this, I allowed docking but I handled the PaneDragOver event and set the IsValidDragAction to false when ever certain dragging actions occur.  This allows you to specify how to restrict the drag docking.

    To hide the close button and file menu button, I create a style that used the same key as the default style so that it overwrote the style.  I then set the Visibility property to collapsed.

    In order to detect the change in state of a docked ContentPane to a floating pane, you can handle the ToolWindowLoaded event.  This event will fire whenever the ToolWindow (floating window) appears.  I then handled the Closing event on this ToolWindow and canceled it when the user clicked on the close button.  This allowed me to remove the ContentPane from the ToolWindow and re-add it back to the TabGroupPane in the DocumentContentHost.

    Let me know if you have any questions.

    WpfApplication1.zip
Reply Children