Is there an equivalent to XamTabControl.PostTabItemContent for a TabGroupPane? I want to add a button there.
Using v16.1, most recent service release.
Hello Walter,
Since the tab items in the TabGroupPane are designed to work differently compared to the tabs in the XamTabControl, there is no such built-in functionality for this in the XamDockManager.
An approach I can suggest you in order to create a custom post-tab area with a Button inside is to create a dummy ContentPane with a null Header and retemplate it by using a trigger for the Header property:
<igDock:TabGroupPane> <igDock:ContentPane Header="Pane 01" /> <igDock:ContentPane Header="Pane 02" /> <igDock:ContentPane /></igDock:TabGroupPane> <Style TargetType="{x:Type igDock:PaneTabItem}"> <EventSetter Event="PreviewMouseDown" Handler="PaneTabItem_PreviewMouseDown" /> <Style.Triggers> <Trigger Property="Header" Value="{x:Null}"> <Setter Property="Background" Value="White" /> <Setter Property="Template"> <Setter.Value> <ControlTemplate> <Button Margin="2" Content="Post-tab area button" /> </ControlTemplate> </Setter.Value> </Setter> </Trigger> </Style.Triggers></Style>
<Style TargetType="{x:Type igDock:PaneTabItem}"> <EventSetter Event="PreviewMouseDown" Handler="PaneTabItem_PreviewMouseDown" /> <Style.Triggers> <Trigger Property="Header" Value="{x:Null}"> <Setter Property="Background" Value="White" /> <Setter Property="Template"> <Setter.Value> <ControlTemplate> <Button Margin="2" Content="Post-tab area button" /> </ControlTemplate> </Setter.Value> </Setter> </Trigger> </Style.Triggers></Style>
private void PaneTabItem_PreviewMouseDown(object sender, MouseButtonEventArgs e){ if (!(sender as PaneTabItem).HasHeader) e.Handled = true;}
I have attached a sample that demonstrates the approach from above. Please note that in order for this to work in any state of the TabGroupPane, some additional manipulation and retemplating may be required.
If you require any further assistance on the matter, please let me know.
We are using the method in this link to dynamically create views in tabs:
http://es.infragistics.com/community/blogs/blagunas/archive/2013/09/24/xamdockmanager-data-binding-contentpanes-with-mvvm.aspx
Is there a way to combine these?
Since the custom post-tab area is actually a PaneTabItem that is used differently for a certain scenario only using behaviors the rest of the PaneTabItems should not be an issue when using MVVM. It would still be dependent on the functionality you are trying to achieve and the implementation of the panes.