How to collapse RightSide LayoutAnchorGroup

Jun 12, 2013 at 12:19 AM
I have the following xaml which works fine, the RightSide items ProcessExplorer and DataExplorer are UserControls that are TreeViews. The User can pick items on the TreeViews and new LayoutDocuments are added to the mainPanel. In version 1.3 we could collapse the RightSide items after a pick without the user moving the mouse off the TreeView. But in version 2.0 I can not figure out how from the code behind to make that happen.

Note we do not allow the user to mess with the Home Page or the RightSide items. That's why the CanClose, CanFloat, CanHide, CanAutoHide are all set to false. On new pages they can do what they want.
<Window x:Class="TestApp.Shell"
    xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
    xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
    xmlns:xctk="http://schemas.xceed.com/wpf/xaml/toolkit"
    xmlns:ad="http://schemas.xceed.com/wpf/xaml/avalondock"
    xmlns:local="clr-namespace:TestApp"
    xmlns:sc="clr-namespace:TestApp.StaticContent"
    Title="TestApp" Width="1024" Height="800"
            Loaded="OnLoaded" IsVisibleChanged="isVisibleChanged" Closing="OnClosing">
<Grid x:Name="ShellRegion">
    <!-- New children, such as the modal dialog box, can be added in the ShellRegion. -->
    <Grid x:Name="DockingRegion">
        <ad:DockingManager x:Name="DockManager" AllowMixedOrientation="True"
            AnchorableContextMenu="{x:Null}">
            <ad:LayoutRoot>
                <ad:LayoutPanel Orientation="Horizontal" x:Name="mainPanel">
                    <ad:LayoutDocumentPaneGroup>
                        <ad:LayoutDocumentPane x:Name="MainWindow">
                            <sc:StartPage Title="Home Page" CanClose="False" CanFloat="False"/>
                    </ad:LayoutDocumentPaneGroup>
                </ad:LayoutPanel>
                <ad:LayoutRoot.RightSide>
                    <ad:LayoutAnchorSide>
                        <ad:LayoutAnchorGroup>
                            </ad:LayoutAnchorable>
                            <ad:LayoutAnchorable Title="Process Explorer" ContentId="processexplorer" x:Name="pxProcessExplorer" 
                                                            AutoHideMinWidth="300"
                                                            CanClose="False" CanFloat="False" CanHide="False" CanAutoHide="False">
                                <sc:ProcessExplorer/>
                            </ad:LayoutAnchorable>
                            <ad:LayoutAnchorable Title="Data Explorer" ContentId="dataexplorer" x:Name="adDataExplorer" 
                                                               AutoHideMinWidth="300"
                                                               CanClose="False" CanFloat="False" CanHide="False" CanAutoHide="False">
                                <sc:DataExplorer/>
                            </ad:LayoutAnchorable>
                        </ad:LayoutAnchorGroup>
                    </ad:LayoutAnchorSide>
                </ad:LayoutRoot.RightSide>
            </ad:LayoutRoot>
        </ad:DockingManager>
    </Grid>
</Grid>
Aug 19 at 9:02 AM
Hi, I have tha same problem. Did you found a solusion?