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
195
How to select multiple ContentPanes ?
posted

I have a xamDockManager and I want to select multiple ContentPanes at once. 

How can I achieve that and at the same time make the multiple selection visible to the user?

  • 34810
    Verified Answer
    Offline posted

    Hello Martin,

    Currently, the panes in the XamDockManager have an "active" state that essentially designates that it is the focused pane, and so there can only ever be a single "active" pane at one time. There currently does not exist any sort of "selection" behavior for the ContentPanes or the XamDockManager.

    In order to implement this, I would recommend creating a custom derivation of ContentPane and adding a bool property that designates whether or not it is selected. You can also hook into perhaps a MouseUp event on the ContentPane in order to mark it as selected or deselected. At that point, I would recommend writing a Style for PaneHeaderPresenter with a DataTrigger that binds to the header presenter's Pane.IsSelected property and marks the Background a color of your choosing to show that the pane is selected.

    Where this becomes a little more difficult is in the floating panes of the XamDockManager, as they will contain a SplitPane that will contain your ContentPane derivations. To keep this behavior consistent, I would recommend handling the ToolWindowLoaded event on the XamDockManager, as this will fire when a pane is floated. At this point, you can set e.Window.UseOSNOnClientArea to false (where e is the event arguments), as this will make styling the window programmatically a bit easier.

    At this point, you can get the SplitPane that exists in the window via e.Window.Pane and loop through that SplitPane's Panes collection to look for a custom ContentPane that is "selected." If you find one, I would recommend using our Utilities class to get a Border and CardPanel descendant by name from e.Window and color their Background. You could do this like so:

    Border border = Utilities.GetDescendantFromName(window, "windowCenterBorder") as Border;
    border.Background = borderBrush;

    CardPanel panel = Utilities.GetDescendantFromName(window, "PART_Caption") as CardPanel;
    panel.Background = captionBrush;

    In this case, the CardPanel is the header area of the floating window, and the Border is the outer border of it. This should highlight the entire floating window.

    I have attached a sample project to demonstrate the above. I hope this helps you.

    If you would like to see pane selection added to the XamDockManager, I would recommend suggesting a new product idea for this feature at http://ideas.infragistics.com. This product ideas site will place you in direct communication with our product management team who plans and prioritizes upcoming features and development based on community and user feedback.

    Please let me know if you have any other questions or concerns on this matter.

    Sincerely,
    Andrew
    Associate Developer

    XamDockManagerPaneSelection.zip