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.
Hi Abhinav,
The CloseButtonVisibility property controls the behavior in the Content pane's header presenter which is not the same as the Close button in the DocumentContentHost. In order to hide the documents' close button you could use a style like the following:
<Style x:Key="{x:Static igDock:TabGroupPane.DocumentCloseButtonStyleKey}" TargetType="{x:Type Button}"> <Setter Property="Visibility" Value="Collapsed" /></Style>
This way the "X" button will not be visible but you'll still have the "Close" menu option.
Hope this helps.
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
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.