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.
The visual difference between a tabgroup in the documentcontenthost and those outside the documentcontenthost is handled in the styles for the TabGroupPane and PaneTabItem. Specifically there is a style trigger in the style of the TabGroupPane that will change the Template and ItemsPanel when its PaneLocation is Document. Similarly, there is a style trigger in the style of the PaneTabItem to change the Template when the PaneLocation is Document. The templates for these two are accessed via a dynamicresource to a resourcekey - TabGroupPane.DocumentTabGroupTemplateKey and PaneTabItem.DocumentTabItemTemplateKey respectively. So you could use the default styles that we ship with the product to remove these triggers or use the other styles.
Can you post an example of this? I tried using Blend to edit a copy of the documentcontenthost's style and didn't find any triggers.
My apologies for being terse, but this doesn't appear to help me solve me problem. I seem to have found a solution and just need a little help to implement it. The solution you outlined in the second post of this thread sounded like a good enough solution, but I am unable to make it happen. I'm asking for some detail and I am hoping you can help.
If you are unable to provide a sample, could you please help me in another way? Maybe you can:
I believe the default styles are included in the install directory in a folder named DefaultStyles. I would avoid trying to use extracted styles/templates from Blend as blend cannot round trip lots of information as it ends up getting the results of MarkupExtensions, etc. instead of what values were used to provide them. That is why we provided the default styles. Once you're in those xaml files, you can look at the styles whose target type is PaneTabItem and TabGroupPane and you should find several style triggers. It is these that you need to modify. If you still have problems changing the style post the sample of what you have so far and we can try to see what else needs to be tweaked.
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>
This is different than what the original post was asking about - which was to make the tab items/groups look like those outside the documentcontenthost. Your situation is different. You are trying to make a content pane within a documentcontenthost look like it would if it were not in the document content host. There's two issues here.
First, the header/title will not be visible for ContentPanes within a DocumentContentHost. The default ContentPane template binds the Visibility of the PaneHeaderPresenter within its template to its HeaderVisibility property which is Collapsed when the CP is in a DCH. You would have to retemplate the ContentPane such that the Visibility of the PaneHeaderPresenter within it is always Visible.
Second, a TabGroupPane that is outside the DocumentContentHost will hide its tabitem area (i.e. not show the tab items) when there is only 1 tab item. It does this because it changes its template to a simplied one when the IsTabItemAreaVisible property is false. This trigger is in the snippet you provided. That property is always true for a TabGroupPane that is within the DocumentContentHost since VS always shows tab items for its documents. There really is no property that you can use to determine that you should do this when in the DocumentContentHost - the Items.Count isn't sufficient since there can be hidden items/placeholders. Although if you know that there will be only 1 in a tabgroup then you can use the same template used in the IsTabItemAreaVisible trigger in your snippet.
With regards to the PaneTabItem, the triggers in the PaneTabItem template are triggering on the PaneLocation property.e.g.<Trigger Property="igDock:XamDockManager.PaneLocation" Value="Document">
Sounds like the work to do this just got a lot bigger. I might be able to make this work given your direction, but I doubt it. When is this feature planned to be (re)released?
Unfortunately I cannot say what features will be included in a future versions. I would recommend submitting a suggestion indicating the functionality that you need. The WinForms UltraDockManager FillContainer LayoutStyle basically took the innermost visible docked dockarea and used that to fill the available area. Panes within it that were unpinned were still unpinned to the edge to which the pane would have been positioned had it not been the fill pane. Also, when all the panes within it were unpinned/closed/floated/dragged elsewhere the new innermost visible docked dockarea would have become the fill pane. If this is the functionality that you want then you can just request that we include the same functionality but if you require something different then please include in that request as much detail as possible the behavior that you would like to see.
With regards to the original posters issue (winforms version of the control works differently to the WPF version), is this functionality due to be ported across?
Many thanks
Paul Eden
I'm sorry but I don't have any information regarding feature release schedules. All I can recommend is that you submit a suggestion for this feature; the number of submissions has a bearing on what features get implemented.