Search code examples
wpfxamlinfragistics

Infragistics - XamDocManager - Limit ContentPanes width in unpinned state


I am using XamDocManager for one of my WPF application. The XamDocManager has two ContentPanes within TabGroupPane as shown in the below XAML.

<igDock:XamDockManager Name="MyXamDM">
<igDock:XamDockManager.Panes>                
    <igDock:SplitPane Name="Sp1" SplitterOrientation="Horizontal" HorizontalAlignment="Left"
              igDock:XamDockManager.InitialLocation="DockedLeft" MaxWidth="100">
        <igDock:TabGroupPane MaxWidth="100">
            <igDock:ContentPane Header="Top" Content="Top" 
                     Name="Cp1"/>
            <igDock:ContentPane Header="Bottom" Content="Bottom" 
                    Name="Cp2" />
        </igDock:TabGroupPane>
    </igDock:SplitPane>
</igDock:XamDockManager.Panes>

I have MaxWidth attribute set to 100 in TabGroupPane and SplitPane.

During run-time I checked two scenarios:

Scenario 1: Pin the contentpanes and increase its width more than 100px

Scenario 2: Unpin the contentpanes and increase its width more than 100px

Scenario 1 works fine, but Scenario 2 failed. I am able to increase the panes width more than 100px when the contentpanes are unpinned. MaxWidth property does not take effect when the contentpanes are unpinned.

Irrespective of whether contentpanes are pinned or unpinned I need to limit its width to 100px.


Solution

  • I am able to control the width of unpinned contentpane by setting MaxWidth property of UnpinnedTabFlyout.

       <igDock:XamDockManager.Resources>
                <Style TargetType="{x:Type igDock:UnpinnedTabFlyout}">
                    <Style.Triggers>
                        <DataTrigger Binding="{Binding RelativeSource={RelativeSource Self},Path=Side}" Value="Left">
                            <Setter Property="MaxWidth" Value="100"/>                            
                        </DataTrigger>                        
                    </Style.Triggers>
                </Style>            
        </igDock:XamDockManager.Resources>
    

    Details on UnpinnedTabFlyout is available here.