How to set the DocumentCloseButtonType in DockingManger ?
CloseButton in DocumentContainer of DockingManager can be changed by
“DocumentCloseButtonType”. DockingManager document close button types are
Both, Common, Extended, Hide, Individual, IndividualonMouseOver.
The same has been explained in the following code snippet:
XAML:
//Code Explains how to set different DocumentCloseButtonType in DockingManager Control <Window x:Class="DockingSample.MainWindow" xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation" xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" xmlns:sync="http://schemas.syncfusion.com/wpf" Title="MainWindow" Height="350" Width="525" > <Grid> <sync:DockingManager DockFill="False" UseDocumentContainer="True" Name="DockSample" ShowTabListContextMenu="True" DocumentCloseButtonType="Extended"> <ContentControl sync:DockingManager.SideInDockedMode="Left" sync:DockingManager.State="Dock" sync:DockingManager.Header="Dock1" sync:DockingManager.IsContextMenuVisible="True"></ContentControl> <ContentControl sync:DockingManager.SideInDockedMode="Right" sync:DockingManager.Header="Dock2"></ContentControl> <ContentControl sync:DockingManager.State="Document" sync:DockingManager.SideInDockedMode="Bottom" sync:DockingManager.Header="Test2" ></ContentControl> </sync:DockingManager> </Grid> </Window>
C#:
//Code Explains how to set different DocumentCloseButtonType in DockingManager namespace DockingSample { public partial class MainWindow : Window { public MainWindow() { InitializeComponent(); DockingManager.DocumentCloseButtonType = CloseButtonType.Hide; } } }
Output:
Both:
Sets the close button on both common and individual tabs.
Common:
Sets the close button as common for all tabs.
Individual:
Sets the close button to individual tab.
IndividualonMouseOver:
Sets the close button when mouse over on the Document header.
Hide:
Hides the close button in docking manager tabs.