Articles in this section
Category / Section

How to customize the close button in DockingManager

1 min read

How to customize the Close button in DockingManager

The close button for the Docked window can be customized using the CloseButtonTemplate and can be used to get or set the control template for the close button for the windows of DockingManager with TargetType as ToggleButton.

 

The same has been explained in the following code snippet

 

XAML:

//Code Explains How to customizing the close button in Docking Manager Control      
<Window
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:syncfusion="http://schemas.syncfusion.com/wpf" x:Class="Docking_CustomizeCloseButtonTemplate_.MainWindow"
Title="MainWindow" Height="350" Width="525">
<Grid>
<syncfusion:DockingManager Name="Docking"  >
<syncfusion:DockingManager.CloseButtonTemplate>
<ControlTemplate TargetType="ToggleButton">
<TextBlock Text="Close" Foreground="Green" Background="Red">
</TextBlock>
</ControlTemplate>
</syncfusion:DockingManager.CloseButtonTemplate>
<ContentControl syncfusion:DockingManager.Header="Dock" syncfusion:DockingManager.DesiredWidthInDockedMode="150" >
</ContentControl>
<ContentControl syncfusion:DockingManager.Header="Dock1" syncfusion:DockingManager.DesiredWidthInDockedMode="150" >
</ContentControl>
<ContentControl syncfusion:DockingManager.Header="Dock1" syncfusion:DockingManager.DesiredWidthInDockedMode="150" >
</ContentControl>
</syncfusion:DockingManager>
</Grid>
</Window>
 

 

Output:

      Customize CloseButton:

               C:\Users\Ashok.Murugesan\Desktop\Switchmode\Docking(CustomizingCloseButton).png

Did you find this information helpful?
Yes
No
Help us improve this page
Please provide feedback or comments
Comments (0)
Please sign in to leave a comment
Access denied
Access denied