Articles in this section
Category / Section

How to restrict maximizing of newly created MDI window when already another MDI Window in Maximized state in DocumentContainer?

1 min read

By default, we cannot open the MDIWindow of DocumentContainer in Normal state, even if one of the MDIWindow is in MaximizedState.To restrict the maximizing behavior of newly created MDI window when already there is a maximized MDI window, the state of MDI window need to restore Normal state.


<Window x:Class="DocumentContainer_MDIwindow.MainWindow"
Title="MainWindow" Height="350" Width="525">
<RowDefinition Height="40"/>
<RowDefinition Height="*"/>
<Button x:Name="Button1" Width="100" Height="23" Click="Button1_Click" Content="Newcontent" Grid.Row="0"/>
<syncfusion:DocumentContainer x:Name="Container"  Mode="MDI" Grid.Row="1" >
<ContentControl syncfusion:DocumentContainer.Header="Document1"/>



namespace DocumentContainer_MDIwindow
    /// <summary>
    /// Interaction logic for MainWindow.xaml
    /// </summary>
    public partial class MainWindow : Window
        public MainWindow()
        void Items_CollectionChanged(object sender, System.Collections.Specialized.NotifyCollectionChangedEventArgs e)
            if (e.Action == System.Collections.Specialized.NotifyCollectionChangedAction.Add)
                foreach (var child in (sender as DocumentCollection))
// Restore the MDI window to Normal state.
                    DocumentContainer.SetMDIWindowState(child as DependencyObject, MDIWindowState.Normal);
        private void Button1_Click(object sender, RoutedEventArgs e)
            ContentControl content = new ContentControl();
            DocumentContainer.SetHeader(content, "Document2");


Did you find this information helpful?
Help us improve this page
Please provide feedback or comments
Comments (0)
Please  to leave a comment
Access denied
Access denied