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
210
ContentPane floating mode close button functionality
posted

We are using xamDockManager and we want to implement close button functionality for content pane (Floating Mode) in a way if we click on close button then it should be dock as per the inital position.

In the below scrreenshots, we have performed Step-1 and Step-2. In Step-2 after clicking on Close button it should be docked as shown in the Step-1.

<UserControl
xmlns:igDock="http://infragistics.com/DockManager"
xmlns:views="clr-namespace:MyView.Views"
>

/* Some Code */
<igDock:XamDockManager x:Name="dockManager" BorderBrush="Black" >
<igDock:XamDockManager.Panes>
           <igDock:SplitPane igDock:XamDockManager.InitialLocation="DockedBottom">
               <igDock:ContentPane x:Name="contentPane" Header="Sample DOck" IsPinned="False" WindowPositionMenuVisibility="Collapsed">
                    <views:MyView DataContext="{Binding Path = MyViewModel}"/>
                </igDock:ContentPane>
           </igDock:SplitPane>
   </igDock:XamDockManager.Panes>
</igDock:XamDockManager> 

Screenshots:

  • 1920
    Offline posted

    Hello Narendra,

    Thank you for posting to Infragistics Community!

    I have been looking into your question and created a small sample with a XamDockManager to demonstrate how such a requirement can be achieved. My suggestion is to handle the ContentPane’s Closed event and toggle its Docked state in case its PaneLocation is Floating or FloatingOnly. In case of the latter, the pane should also be made dockable again. These actions can be performed by executing the ContentPaneCommands ChangeToDockable and ToggleDockedState. Additionally, as closing a pane is essentially setting its Visibility property to Collapsed by default, it has to be set to “Visible” in order to display it.

    private void ContentPane_Closed(object sender, Infragistics.Windows.DockManager.Events.PaneClosedEventArgs e)
            {
                ContentPane cp = e.OriginalSource as ContentPane;
    
                if(cp.PaneLocation == PaneLocation.FloatingOnly)
                {
                    cp.ExecuteCommand(ContentPaneCommands.ChangeToDockable);
                    cp.ExecuteCommand(ContentPaneCommands.ToggleDockedState);
                    cp.Visibility = Visibility.Visible;
                    return;
                }
    
                if(cp.PaneLocation == PaneLocation.Floating)
                {
                    cp.ExecuteCommand(ContentPaneCommands.ToggleDockedState);
                    cp.Visibility = Visibility.Visible;
                }
            }

    In conclusion, please test the below attached sample on your side and let me know how it behaves. If this is not an accurate demonstration of what you would like to achieve, please provide more details regarding your requirement, or modify the sample with the relevant code to reproduce the behavior and send it back to me.

    Best regards,
    Bozhidara Pachilova
    Associate Software Developer

    8233.XDMHidePanes.zip