Hi,
We are using Infragistics DockManager v10.1. Inside the dockMgr we have a DocumentContentHost, inside which we have a SplitPane, then a TabGroupPane, and then several ContentPanes. We are setting the AllowClose property of the ContentPane as true and the CloseButtonVisibility property as Hidden. We want to be able to close the contentpane using the close menu item in the contentpane's header's right click context menu and hence we have set the AllowClose to true, and this works fine. However, we don't want the 'X' close button on the top right corner of the contenpane and that is why we have set the CloseButtonVisibility to Hidden. But inspite of this, the 'X' close button still shows up. Any advise is greatly appreciated.
Thanks,
Abhinav.
Hello James,
Thank you for the sample application.
I reviewed the behavior you described and found out that the close button is not affected by the style suggested in the initial post because the Office2013 theme, as well as Metro, MetroDark and RoyalDark themes, use another style for that button. So it’s not the ThemeManager that causes the issue in the current setup but the style itself. In order to collapse the button for the 4 themes I mentioned above, I would suggest using the following style:
<Style TargetType="{x:Type igWPF:DocumentContentHost}"> <Style.Resources> <Style x:Key="{x:Static igWPF:PaneHeaderPresenter.CloseButtonStyleKey}" TargetType="{x:Type Button}"> <Setter Property="Visibility" Value="Collapsed" /> </Style> </Style.Resources> </Style>
<Style.Resources>
<Style x:Key="{x:Static igWPF:PaneHeaderPresenter.CloseButtonStyleKey}" TargetType="{x:Type Button}">
<Setter Property="Visibility" Value="Collapsed" />
</Style>
</Style.Resources>
I implemented this approach in the sample application I am attaching for your reference. Please, review it and let me know if you need further assistance.
Hello Galina
Thank you for your solution first.
But I found that Your approach doesn't work when I use ThemeManager.ApplicationTheme
If I commented it out in App.xaml.cs, then It works well.
Please check attached file and help me apply your solution.
Many thanks in advance
The approach that Galina mentions in this thread can be used to hide the close button within the TabGroupPane in the DocumentContentHost. If you want to show a close button within a tab then you can follow the approach I described in this other thread.
We use XamDockManager to create a DocumentContentHost to host SplitPanes and TabGroupPane. is there a way to show the close button (x) only on individual tabs and not on the far right corner of the DocumentContentHost?
Regards,
Harman
This solution worked. Thanks for the help.