Articles in this section
Category / Section

How to restrict the resizing of the FloatWindowHeight?

1 min read

The resizing of the height of the float window can be restricted by using the CanResizeHeightInFloatState property. This property is Boolean. It restricts the resizing of the height of the float window of the corresponding floating child depending upon its values. When the CanResizeHeightInFloatState property is set to true, the height of the float window can be resized and when the CanResizeHeightInFloatState property is set to false, the height cannot be resized. The same has been demonstrated in the following code example:

XAML

//The CanResizeHeightInFloatState property is set to true for the corresponding floating child in the DockingManager.
<Window x:Class="DockingManager_floatwindowsample.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 x:Name="Dock1" UseDocumentContainer="True"   >
         <ContentControl syncfusion:DockingManager.Header="Dock1"
                         syncfusion:DockingManager.State="Float"
                         syncfusion:DockingManager.CanResizeHeightInFloatState="True">
             </ContentControl>
         <ContentControl syncfusion:DockingManager.Header="Dock2"
                          syncfusion:DockingManager.State="Dock">
         </ContentControl>
         <ContentControl syncfusion:DockingManager.Header="Dock3"
                          syncfusion:DockingManager.State="Dock">
         </ContentControl>
         <ContentControl syncfusion:DockingManager.Header="Dock4"
                          syncfusion:DockingManager.State="Document">
         </ContentControl>
         <ContentControl syncfusion:DockingManager.Header="Dock5"
                          syncfusion:DockingManager.State="Document">
         </ContentControl>
       </syncfusion:DockingManager>
    </Grid>
</Window>

 

C#

//The CanResizeHeightInFloatState property is set to true for the corresponding floating child in the DockingManager.
using Syncfusion.Windows.Tools.Controls;
namespace DockingManager_floatwindowsample
{
    /// <summary>
    /// Interaction logic for MainWindow.xaml.
    /// </summary>
    public partial class MainWindow : Window
    {
        public MainWindow()
        {
            InitializeComponent();
            DockingManager Docking = new DockingManager();
            Docking.UseDocumentContainer = true;
            ContentControl content1 = new ContentControl();
            DockingManager.SetHeader(content1, "Dock1");
            DockingManager.SetState(content1, DockState.Float);
            DockingManager.SetCanResizeHeightInFloatState(content1, true);
            ContentControl content2 = new ContentControl();
            DockingManager.SetHeader(content2, "Dock2");
            DockingManager.SetState(content2, DockState.Dock);
            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.Document);
            Docking.Children.Add(content1);
            Docking.Children.Add(content2);
            Docking.Children.Add(content3);
            Docking.Children.Add(content4);
            Grid1.Children.Add(Docking);
         }
    }

 

The following screenshot shows how the height of the float window is resized to some extent:

Figure 1: Height of the float window is resized

XAML

//The CanResizeHeightInFloatState property is set to false for the corresponding floating child in the DockingManager.
<Window x:Class="DockingManager_floatwindowsample.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 x:Name="Dock1" UseDocumentContainer="True"   >
         <ContentControl syncfusion:DockingManager.Header="Dock1"
                         syncfusion:DockingManager.State="Float"
                         syncfusion:DockingManager.CanResizeHeightInFloatState="False">                 
         </ContentControl>
         <ContentControl syncfusion:DockingManager.Header="Dock2"
                          syncfusion:DockingManager.State="Dock">
         </ContentControl>
         <ContentControl syncfusion:DockingManager.Header="Dock3"
                          syncfusion:DockingManager.State="Dock">
         </ContentControl>
         <ContentControl syncfusion:DockingManager.Header="Dock4"
                          syncfusion:DockingManager.State="Document">
         </ContentControl>
         <ContentControl syncfusion:DockingManager.Header="Dock5"
                          syncfusion:DockingManager.State="Document">
         </ContentControl>
       </syncfusion:DockingManager>
    </Grid>
</Window>

 

C#

//The CanResizeHeightInFloatState property is set to false for the corresponding floating child in the DockingManager.
using Syncfusion.Windows.Tools.Controls;
namespace DockingManager_floatwindowsample
{
    /// <summary>
    /// Interaction logic for MainWindow.xaml
    /// </summary>
    public partial class MainWindow : Window
    {
        public MainWindow()
        {
            InitializeComponent();
            DockingManager Docking = new DockingManager();
            Docking.UseDocumentContainer = true;
            ContentControl content1 = new ContentControl();
            DockingManager.SetHeader(content1, "Dock1");
            DockingManager.SetState(content1, DockState.Float);
            DockingManager.SetCanResizeHeightInFloatState(content1, false);
            ContentControl content2 = new ContentControl();
            DockingManager.SetHeader(content2, "Dock2");
            DockingManager.SetState(content2, DockState.Dock);
            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.Document);
            Docking.Children.Add(content1);
            Docking.Children.Add(content2);
            Docking.Children.Add(content3);
            Docking.Children.Add(content4);
            Grid1.Children.Add(Docking);
    }
    }
}

 

The following screenshot shows how the height of the float window remains the same.

Figure 2: The height of the float window remains the same

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