I am using Infragistics 12.2 TabGroupPane with out using XamDockManager. The pins are disabled on the TabGroupPane. I want to enable the pins on the TabGroupPane. How can I do this?
<UserControl x:Class="NavigationPanelView"xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006" xmlns:d="http://schemas.microsoft.com/expression/blend/2008"xmlns:igWPF="http://schemas.infragistics.com/xaml/wpf" <igWPF:TabGroupPane TabStripPlacement="Top" SelectedIndex="0" HorizontalContentAlignment="Stretch" > <igWPF:ContentPane ... ... </igWPF:ContentPane> <igWPF:ContentPane ... ... </igWPF:ContentPane> </igWPF:TabGroupPane></UserControl>
Thank you,
L
Hello Lala,
Thank you for your post. I have been looking into your requirement and in order to be able to use the pinning functionality of the ContentPanes, they should be added in a XamDockManager, which is controlling the pinning. Since you are using a standalone TabGroupPane, I assume that you wish to use it as a TabControl that allows pining. You can achieve that using XamDockManager by disabling the dragging of the ContentPane, which will restrict moving the ContentPanes and also by setting the AllowFloatingOnly and AllowFloaringDockable properties of the ContentPant to false, which will remove the Floating option of the ContentPane’s menu. By implementing this, the TabGroupPane will appear standalone and you will be able to use the pinning. I have created a sample application for you, that shows how you can implement this approach.
Please let me know if you need any further assistance on the matter.
Sincerely,
Krasimir
Developer Support Engineer
Infragistics
www.infragistics.com/support
I am just checking if you require any further assistance on the matter.
Hi Krasimir ,
I have a similar requirement , i would like to use the TabGroupPane as a tabControl that supports Floating panes, so i would like to bind each content pane to a VM that will determine if it can be closed . i would also like to allow a single docking area so all panes are in the same TabStrip. can you also specify how i can style the tab Name in the Tabstrip .
i am also using the TabGroupPane MVVM solution from one of the blog posts using a behavior (can't find the link right now).
Hello Shaul,
Thank you for your reply. I have been looking into your question and you can bind the AllowClose property of the ContentPane to determine whether a ContentPane can be close or not. You can do that by using a style for the ContentPane and add a Setter for the AllowClose property as follows:
<Style TargetType="{x:Type igWPF:ContentPane}">
<Setter Property="AllowFloatingOnly" Value="False"/>
<Setter Property="AllowDockingFloating" Value="False"/>
<Setter Property="AllowClose" Value="{Binding <You, Binding Definition>}"/>
</Style>
Regarding the styling of the TabStrip, I assume that you are referring to UnpinnedTabArea of the XamDockManagter (the area that holds the ContentPane’s headers, when the ContentPanes are unpinned), you can create a style for the UnpinnedTabArea and style it, to achieve the appearance that you are looking for. Here is an example for that:
<!-- ================================ -->
<!-- UnpinnedTabArea -->
<Style TargetType="{x:Type igDock:UnpinnedTabArea}">
<Setter Property="Background" Value="Yellow"/>
<!-- If you wish to change the template, you can change the tempalte below -->
<!--<Setter Property="Template">
<Setter.Value>
<ControlTemplate TargetType="{x:Type igDock:UnpinnedTabArea}">
<Border Background="{TemplateBinding Background}"
BorderBrush="{TemplateBinding BorderBrush}"
BorderThickness="{TemplateBinding BorderThickness}">
<igWindows:XamPager x:Name="TabItemScrollViewer" Focusable="False">
<ItemsPresenter x:Name="PART_TabHeaderPanel" />
</igWindows:XamPager>
</Border>
<ControlTemplate.Triggers>
<Trigger Property="TabControl.TabStripPlacement" Value="Top">
<Setter Property="Margin" Value="0,2,0,0" />
<Setter Property="Margin" TargetName="PART_TabHeaderPanel" Value="-12,0,0,0"/>
<Setter Property="ScrollViewer.VerticalScrollBarVisibility" TargetName="TabItemScrollViewer" Value="Disabled"/>
<Setter Property="ScrollViewer.HorizontalScrollBarVisibility" TargetName="TabItemScrollViewer" Value="Auto"/>
</Trigger>
<Trigger Property="TabControl.TabStripPlacement" Value="Bottom">
<Setter Property="Margin" Value="0,0,0,2" />
<Trigger Property="TabControl.TabStripPlacement" Value="Left">
<Setter Property="Margin" Value="2,0,0,0" />
<Setter Property="Margin" TargetName="PART_TabHeaderPanel" Value="0,-12,0,0"/>
<Setter Property="ScrollViewer.VerticalScrollBarVisibility" TargetName="TabItemScrollViewer" Value="Auto"/>
<Setter Property="ScrollViewer.HorizontalScrollBarVisibility" TargetName="TabItemScrollViewer" Value="Disabled"/>
<Trigger Property="TabControl.TabStripPlacement" Value="Right">
<Setter Property="Margin" Value="0,0,2,0" />
<Trigger Property="UIElement.IsEnabled" Value="False">
<Setter Property="TextElement.Foreground" Value="{DynamicResource {x:Static igDock:DockManagerBrushKeys.GrayTextBrushKey}}"/>
</ControlTemplate.Triggers>
</ControlTemplate>
</Setter.Value>
</Setter>-->
Regarding you last question, I assume that you wish to change the appearance of the headers of the ContentPanes when they are unpinned. If this is correct, you can create a style for the PaneTabItem and using a trigger, you can determine whether the ContentPane is unpinned and change its appearance. Here is how you can do that:
<Style TargetType="{x:Type igDock:PaneTabItem}">
<Style.Triggers>
<DataTrigger Binding="{Binding RelativeSource={RelativeSource Self}, Path=Pane.IsPinned}" Value="false">
<Setter Property="Background" Value="Red"/>
</DataTrigger>
</Style.Triggers>
Krasimir, MCPD
Developer Support Supervisor - XAML