Hi. I would like to enable/disable tabs hosted by a XamDockManager based on certain conditions. Setting the IsEnabled property to "false" for the content pane does not work, as I would like to tab to not be "clickable"until I want it to be so. How may I accomplish this? Thanks!
Hi Byron,
My appologies in advance, but I'm not completely sure what exactly you need. Please, check out the attached sample project where I've disabled the first tab item.
If that's not what you need could you explain a bit more or modify the project so that I can have a look again.
Thanks.
Galina,
I discovered what the problem is. It seems that if I set the following property for a ContentPane, the pane will be selectable, even if you have IsEnabled set to "false" for the pane.
AllowInDocumentHost="False"
Indeed, the content on the pane is disabled, but the pane is selectable. This is a problem because there is a case where I'd prefer to not have tabs removed/docked. Is this possible?
Regards,
Byron
Thanks for the response. I'm not sure if this makes a difference, but my XamDockManager contains panes that are of type "Infragistics.Windows.DockManager.ContentPane". My XamDockManager is laid out like this:
<igDock:XamDockManager x:Name="xamDockManager1" Theme="Generic" NavigationOrder="ActivationOrder" AllowDrop="False" Grid.Row="0"> <igDock:DocumentContentHost> <igDock:SplitPane> <igDock:TabGroupPane x:Name="tabGroup1" SelectionChanged="tabGroup1_SelectionChanged"> <!-- Add Company --> <igDock:ContentPane x:Name="addCompanyPane" Header="Add Company" HorizontalAlignment="Stretch" BorderThickness="0" AllowClose="False" AllowDocking="False" AllowPinning="False" AllowDockingFloating="False" AllowInDocumentHost="False" Padding="5"> <!-- content removed ---> </igDock:ContentPane> </igDock:TabGroupPane> </igDock:SplitPane> </igDock:DocumentContentHost> </igDock:XamDockManager>
Setting one of the panes to IsEnabled="False" allows for the tab to be clicked. In the example you sent, I cannot click the tab and it is grayed out. THanks for the help!
Hi byronking,
You need to apply the style to igDock:PaneTabItem and add some triggers according to the conditions under which you want to apply that.
For example:
<Style TargetType="{x:Type igDock:PaneTabItem}"> <Style.Triggers> <Trigger Property="Header" Value="CP 1"> <Setter Property="IsEnabled" Value="False"/> </Trigger> </Style.Triggers></Style>
Hope this helps.