How to hide the Close button in a document?
You can hide the Close button of a document tab in DockingManager using the DisabledCloseButtonBehavior property.
CanClose property
You can restrict closing a document by setting the CanClose property as False. But the Close button is visible in TabItem and this may be confusing. So it is preferred to hide or collapse the Close button.
DisabledCloseButtonBehavior property
The Close button can be hidden by setting the DisabledCloseButtonBehavior property to Hide for DockingManager. This sets the Visibility of the Close button as Hidden. You can also collapse or disable the Close button by setting Collapse and Disable in DisabledCloseButtonBehavior.
MainWindow.Xaml
<syncfusion:DockingManager Name="Docking" UseDocumentContainer="True" DisabledCloseButtonsBehavior="Hide" DocumentCloseButtonType="Individual"> <ContentControl Name="Child" syncfusion:DockingManager.CanClose="False" syncfusion:DockingManager.Header="Dock1" syncfusion:DockingManager.State="Document"> </ContentControl> <ContentControl syncfusion:DockingManager.CanClose="True" syncfusion:DockingManager.Header="Dock2" syncfusion:DockingManager.State="Document"> </ContentControl> <ContentControl syncfusion:DockingManager.CanClose="True" syncfusion:DockingManager.Header="Dock3" syncfusion:DockingManager.State="Document"> </ContentControl> <ContentControl syncfusion:DockingManager.CanClose="True" syncfusion:DockingManager.Header="Dock4" syncfusion:DockingManager.State="Document"> </ContentControl> <ContentControl syncfusion:DockingManager.CanClose="True" syncfusion:DockingManager.Header="Dock5" syncfusion:DockingManager.State="Document"> </ContentControl> </syncfusion:DockingManager>
The above code hides the Close button of the document with the header “Dock1” as displayed in the following screenshot.