Category / Section
How can I set BorderBrush for the selected Floatwindow in DockingManager?
1 min read
The BorderBrush for the selected Floatwindow can be changed by using the FloatWindowSelectedBorderBrush property of the DockingManager. The following code example demonstrates the same:
XAML
//The following code is used to demonstrate how to set the BorderBrush for the selected FloatWindow: <Window x:Class="DockWindow_Property.MainWindow" 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" Title="MainWindow" Height="350" Width="525" > <Grid x:Name="Grid1"> <syncfusion:DockingManager UseDocumentContainer="True" UseNativeFloatWindow="True" FloatWindowSelectedBorderBrush="Green" > <ContentControl syncfusion:DockingManager.Header="Dock1" syncfusion:DockingManager.State="Dock" ></ContentControl> <ContentControl syncfusion:DockingManager.Header="Dock2" syncfusion:DockingManager.State="Float" ></ContentControl> <ContentControl syncfusion:DockingManager.Header="Dock3" syncfusion:DockingManager.State="Dock" ></ContentControl> <ContentControl syncfusion:DockingManager.Header="Dock4" syncfusion:DockingManager.State="Dock" ></ContentControl> <ContentControl syncfusion:DockingManager.Header="Dock5" syncfusion:DockingManager.State="Dock"> </syncfusion:DockingManager> </Grid> </Window>
C#
//The following code is used to demonstrate how to set the BorderBrush for the selected FloatWindow: using Syncfusion.Windows.Tools.Controls; namespace DockWindow_Property { /// <summary> /// Interaction logic for MainWindow.xaml /// </summary> public partial class MainWindow : Window { public MainWindow() { InitializeComponent(); DockingManager dock = new DockingManager(); dock.FloatWindowSelectedBorderBrush = Brushes.Green; ContentControl content1 = new ContentControl(); DockingManager.SetHeader(content1, "Dock1"); DockingManager.SetState(content1, DockState.Dock); ContentControl content2 = new ContentControl(); DockingManager.SetHeader(content2, "Dock2"); DockingManager.SetState(content2, DockState.Float); ContentControl content3 = new ContentControl(); DockingManager.SetHeader(content3, "Dock3"); DockingManager.SetState(content3, DockState.Dock); ContentControl content4 = new ContentControl(); DockingManager.SetHeader(content4, "Dock4"); DockingManager.SetState(content4, DockState.Dock); ContentControl content5 = new ContentControl(); DockingManager.SetHeader(content5, "Dock5"); DockingManager.SetState(content5, DockState.Dock); dock.Children.Add(content1); dock.Children.Add(content2); dock.Children.Add(content3); dock.Children.Add(content4); dock.Children.Add(content5); Grid1.Children.Add(dock); } } }
Output:
The following output shows the BorderBrush that has been applied for the selected FloatWindow.
|
Figure 1: Ouput