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
50
DocumentContentHost Tabs Visual Style
posted

Hello!

Currently XamDockManager only allows docking at the edges leaving the central area for the content. For our application we do not want this central space, we want all the dock manager client area available for docking. I.e. we want the standard behaviour of the DockPanel when the last child fills all the rest of the space. Infragistics dock manager for WinForms allowed it by setting some property, which was extremely handy. I read the forum and learnt that I'm not the first to request this functionality and it is not currently available.

So, I want to ask about different approach: is it possible to adjust the visual representation of the DocumentContentHost so that its Tabs look like the Tabs of the panes docked to the edge and it does not have a thick border?

 Thanks in advance,

Andrey.

Parents Reply
  • 600
    posted in reply to Andrew Smith [Infragistics]

    Thanks. This shows my ignorance of your controls -- the default styles didn't help me because I couldn't find any triggers on the PaneTabItem that referenced how it's hosted. There's a lot there so maybe I missed something. I've included a sample that contains 4 contentpanes, 2 hosted in the documentcontenthost and two hosted right off the dockmanager.

    The objective is to override the styling of the red and blue panes so they are presented the same way as the green and yellow panes. I've got a style resource that attetmpts to override this presentation, but no luck. What am I missing?

    <Window x:Class="Test"
        xmlns="
    http://schemas.microsoft.com/winfx/2006/xaml/presentation"
        xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
        xmlns:igDock="http://infragistics.com/DockManager"
        xmlns:igWindows="http://infragistics.com/Windows">
        <Window.Resources>
            <Style x:Key="OverrideDocumentTabGroupPaneStyle" TargetType="{x:Type igDock:TabGroupPane}">
                <Setter Property="TabStripPlacement" Value="Bottom"/>
                <Setter Property="igWindows:XamTabControl.TabLayoutStyle" Value="SingleRowJustified"/>
                <Setter Property="BorderBrush" Value="{DynamicResource DockManagerBrushKeys.ContentPaneBorderFillKey}"/>
                <Setter Property="Background" Value="{DynamicResource DockManagerBrushKeys.TabbedListActiveBottomCenterFillKey}"/>
                <Setter Property="SnapsToDevicePixels" Value="True"/>
                <Setter Property="Template" Value="{DynamicResource TabGroupPane.DockableTabGroupTemplateKey}"/>
                <Style.Triggers>
                    <Trigger Property="igDock:XamDockManager.PaneLocation" Value="Document">
                        <Setter Property="Template" Value="{DynamicResource TabGroupPane.DockableTabGroupTemplateKey}"/>
                        <Setter Property="ItemsPanel">
                            <Setter.Value>
                                <ItemsPanelTemplate>
                                    <igDock:DocumentTabPanel IsItemsHost="True" TabStripPlacement="{Binding Path=TabStripPlacement, RelativeSource={RelativeSource FindAncestor, AncestorLevel=1, AncestorType={x:Type igDock:TabGroupPane}}}"/>
                                </ItemsPanelTemplate>
                            </Setter.Value>
                        </Setter>
                    </Trigger>
                    <Trigger Property="IsTabItemAreaVisible" Value="False">
                        <Setter Property="Template">
                            <Setter.Value>
                                <ControlTemplate TargetType="{x:Type igDock:TabGroupPane}">
                                    <Grid>
                                        <ItemsPresenter MaxHeight="1" MaxWidth="1" Visibility="Hidden"/>
                                        <ContentPresenter Margin="{TemplateBinding Padding}" x:Name="PART_SelectedContentHost" SnapsToDevicePixels="{TemplateBinding SnapsToDevicePixels}" Content="{TemplateBinding SelectedContent}" ContentSource="SelectedContent" ContentTemplate="{TemplateBinding SelectedContentTemplate}"/>
                                    </Grid>
                                </ControlTemplate>
                            </Setter.Value>
                        </Setter>
                    </Trigger>
                </Style.Triggers>
            </Style>
        </Window.Resources>
        <igDock:XamDockManager>
            <igDock:XamDockManager.Panes>
                <igDock:SplitPane igDock:XamDockManager.InitialLocation="DockedTop">
                    <igDock:TabGroupPane>
                        <igDock:ContentPane>
                            <Rectangle Fill="Green" Width="300" Height="300" />
                        </igDock:ContentPane>
                    </igDock:TabGroupPane>
                    <igDock:TabGroupPane>
                        <igDock:ContentPane>
                            <Rectangle Fill="Yellow" Width="300" Height="300" />
                        </igDock:ContentPane>
                    </igDock:TabGroupPane>
                </igDock:SplitPane>
            </igDock:XamDockManager.Panes>
            <igDock:DocumentContentHost>
                <igDock:SplitPane>
                    <igDock:TabGroupPane Style="{DynamicResource OverrideDocumentTabGroupPaneStyle}">
                        <igDock:ContentPane>
                            <Rectangle Fill="Red" Width="300" Height="300" />
                        </igDock:ContentPane>
                    </igDock:TabGroupPane>
                    <igDock:TabGroupPane Style="{DynamicResource OverrideDocumentTabGroupPaneStyle}">
                        <igDock:ContentPane>
                            <Rectangle Fill="Blue" Width="300" Height="300" />
                        </igDock:ContentPane>
                    </igDock:TabGroupPane>
                </igDock:SplitPane>
            </igDock:DocumentContentHost>
        </igDock:XamDockManager>
    </Window>

Children