By default, the TabGroupPane within the DocumentContentHost shows a common Close (little x) button at the far right, which when clicked closes the currently active ContentPane. How do we change this so the Header within each ContentPanel has the Close button as well?
If this is possible using styles or templates, a detailed example would be much appreciated.
When a ContentPane is within a DocumentContentHost it doesn't show a header so you''re probably referring to the tab item, which is actually an instance of a PaneTabItem. I can think of a couple of options. You can retemplate the PaneTabItem so that it contains a Button whose command is ContentPaneCommands.Close with a CommandTarget of its Pane property. Another approach would be to set the TabHeaderTemplate to a DataTemplate that contains a button with the same command(target) I mentioned for the previous approach.
e.g. The datatemplate could be something like:
Then set the TabHeaderTemplate on the ContentPane to that:
Hi, I would also like to hide/collapse the delete button on items which is not allowed to close, meaning where the AllowClose parameter is set to False.
I've tried to modify your code with a MultiTrigger, but the close button is still visible on items where AllowClose = False.
<MultiTrigger> <MultiTrigger.Conditions> <Condition Property="igDock:XamDockManager.PaneLocation" Value="Document" /> <Condition Property="igDock:ContentPane.AllowClose" Value="True" /> </MultiTrigger.Conditions> <Setter TargetName="closeBtn" Property="Visibility" Value="Visible" /></MultiTrigger>
Do you have any suggestions?