Articles in this section
Category / Section

How to resize the FloatWindow dynamically depending on child size?

1 min read

Resizing the float window size, dynamically depends upon the child size in Docking Manager. You can bind the size of the Content control with width and height using DockingManager.FloatWindowWidth and DockingManager.FloatWindowHeight property.

FloatWindowWidth Property

The FloatWindowWidth property is used to set the width dynamically for the FloatWindow.

FloatWindowHeight Property

The FloatWindowHeight Property is used to set the height dynamically for the FloatWindow.

The following code example illustrates the above.

MainWindow.Xaml

<syncfusion:DockingManager Name="dockingmanager" Grid.Row="0" Loaded="dock1_Loaded" UseDocumentContainer="True">  
         <ContentControl Name="dock1" Width="700" Height="500" syncfusion:DockingManager.State="Float" syncfusion:DockingManager.Header="FloatState" />
        <ContentControl Name="dock2" Width="400" Height="500"
                        syncfusion:DockingManager.State="Dock"
                        Syncfusion:DockingManager.Header="Dockstate"
                         ></ContentControl>
        <ContentControl Name="dock3" Width="400" Height="500"
                        Syncfusion:DockingManager.State="Document"
                        Syncfusion: DockingManager.Header="Document State"></ContentControl> 
        </syncfusion:DockingManager> 

MainWindow.cs

Private void dock1_Loaded (object sender, RoutedEventArgs e)
{
// To resize the FloatwindowWidth dynamically according to its child size.
            Binding bind = new Binding();
            bind.Path = new PropertyPath("Width");
            bind.Source = dock1;
            bind.Mode = BindingMode.OneWay;
            dock1.SetBinding(DockingManager.FloatWindowWidthProperty, bind);
}
Private void dock1_Loaded (object sender, RoutedEventArgs e)
{
//To resize the FloatwindowHeight dynamically according to its child size
              Binding bind = new Binding();
            bind.Path = new PropertyPath("Height");
            bind.Source = dock1;
            bind.Mode = BindingMode.OneWay;
            dock1.SetBinding(DockingManager.FloatWindowHeightProperty, bind);
}

You can render the following output by setting the FloatWindowWidthProperty.

Figure 1: FloatWindowWidth property

You can render the following output by setting the FloatWindowHeightProperty.

Figure 2: FloatWindowHeightProperty

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