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
600
Programmatically pinning and unpinning contentpanes in tabgrouppane
posted

I'm using the XamDockManager to organize my layout. I've got several TabGroupPanes to which I add views at runtime. In addition to the built in controls you provide for pinning and unpinning a pane, I also have menu items that allow the user to control the pinned state of these ContentPanes. I'm finding that unpinning is easy, but repinning is not.

I'm probably going about this the wrong way, maybe I should be tapping into this through commands. The way I've got it hooked up now is through event handlers on the item, manually setting the IsPinned property on one of the ContentPane's in the TabGroupPane. The user invokes the pin/unpin action, an event handler is toggling the IsPinned property on the corresponding ContentPane. But once it's unpinned, the TabGroupPane no longer contains a ContentPane, it contains a ContentPanePlaceholder.

 

Parents
  • 54937
    Verified Answer
    Offline posted

    I'm not sure from your description what you're doing but that is correct that the ContentPane are removed from the TabGroupPane and moved elsewhere when the Pane is unpinned. The ContentPane really doesn't have any strict relation to a given parent - its parent will change as it is unpinned, dragged from one place to another by an end user, have its location changes using one of the available commands (e.g. dockable, floating, document), toggle from docked to floating (e.g. clicking the caption/tab item), etc. The ContentPanePlaceholder is used internally to maintain its position in a given parent for a given state (e.g. floating/docked). It sounds like you're putting some UI on the TabGroupPane itself but that sounds fragile as the ContentPane can be moved elsewhere (not just via unpinning). Perhaps you would put your additional options on the ContentPane itself - e.g. handling the OptionsMenuOpening and adding to its menu items or customizing the PaneHeaderPresenter and putting in your own buttons.

Reply Children
No Data