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
70
How to freeze/lockdown the layout of xamDockManager?
posted

I would like to be able to completely "freeze" the layout of the panes contained within xamDockManager. The idea is to have a setup mode, in which the user can arrange and resize the panes, and then an operating mode in which the pane sizes and layout are locked down.

I can accomplish most of what I want using the existing ContentPanel properties, however there are two problems I'm struggling with:

  1. I cannot consistently prevent panels from being resized. Setting properties such as MinWidth and MaxWidth works in a few cases, but not consistently.
  2. I cannot completely prevent panes from being dragged around and re-docked. For example, if a pane is docked on the left side, I can prevent it from becoming floating or docked on the right side, but I cannot prevent it from being dragged to a new docked location on the left side.

 

Any suggestions for solving either of these problems?

Parents
  • 54937
    Verified Answer
    Offline posted

    dmackersie said:
    I cannot consistently prevent panels from being resized. Setting properties such as MinWidth and MaxWidth works in a few cases, but not consistently.

    Instead of setting those properties perhaps you can create a Style that targets PaneSplitter with a setter that sets IsHitTestVisible to false. If you're not setting the Theme property you can probably put this into the application's resources so it affects the floating windows. If you're setting the Theme then you'll probably need to put this into the Resources of the xamDockManager as well as the Resources of any PaneToolWindow (i.e. hook the ToolWindowLoaded and have added it into each toolwindow's resources) since the Theme's local style will take precendence otherwise.

    dmackersie said:
    I cannot completely prevent panes from being dragged around and re-docked. For example, if a pane is docked on the left side, I can prevent it from becoming floating or docked on the right side, but I cannot prevent it from being dragged to a new docked location on the left side

    You could handle the PaneDragStarting and set Cancel to true if you want to prevent all drag operations. If you want to selectively prevent the operations then you can handle the PaneDragOver but the docking indicators will be shown since we need to show them to find out which one you're over to find out what the resulting drop operation would be in order to raise the event.

Reply Children
No Data