Articles in this section
Category / Section

How to set the foreground and background color for the selected Floatwindow header in DockingManager?

1 min read

The Foreground and Background for the selected FloatWindow headers can be changed by using FloatWindowSelectedHeaderForeground and FloatWindowSelectedHeaderBackground property of DockingManager. Refer to the following code examples.

XAML

//The following code used to demonstrate how to set the foreground and background for the selected floatwindow header:
<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" FloatWindowSelectedHeaderForeground="Yellow" FloatWindowSelectedHeaderBackground="Brown">
          <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">
         </ContentControl>
        </syncfusion:DockingManager>
    </Grid>
</Window>

 

C#

//The following code used to demonstrate how to set the foreground and background for the selected floatwindow header:
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.FloatWindowSelectedHeaderForeground = Brushes.Yellow;
            dock.FloatWindowSelectedHeaderBackground = Brushes.Brown;
            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);                               
        }
    }
}

 

The following screenshot displays how to apply foreground and background for the selected FloatWindow headers of DockingManager:

 

         

 

 

 

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