Category / Section
How to find the window state of float window in WPF DockingManager?
1 min read
The window state (Normal, Minimized, Maximized) of a float window can be retrieved using GetFloatWindowState() method in WPF DockingManager. The same has been explained in the following code.
<Grid> <Grid.RowDefinitions> <RowDefinition Height="40"/> <RowDefinition Height="*"/> </Grid.RowDefinitions> <Button x:Name="_Statechanged" Width="150" Height="23" Content="Get FloatWindowstate" Click="FloatWindowState1" Grid.Row="0" /> <syncfusion:DockingManager x:Name="Docking" UseDocumentContainer="True" Grid.Row="1" UseNativeFloatWindow="True"> <ContentControl x:Name="Child1" syncfusion:DockingManager.Header="Content1" syncfusion:DockingManager.State="Float" syncfusion:DockingManager.CanFloatMaximize="True"/> <ContentControl x:Name="Child2" syncfusion:DockingManager.Header="Content2" syncfusion:DockingManager.State="Document" syncfusion:DockingManager.CanFloatMaximize="True"/> </syncfusion:DockingManager> </Grid>
C#
private void FloatWindowState1(object sender, RoutedEventArgs e) { WindowState m = DockingManager.GetFloatWindowState(Child1); MessageBox.Show("Element window state is " + m.ToString()); }