Resize applic. or splitcontainer does not fire sizechanged

Docking/MDI for WPF Forum

Posted 9 years ago by Arthur Damen
Version: 9.2.0510
Platform: Windows Forms Controls
Environment: Windows Vista (32-bit)
Avatar
Whren you run the next code yo uwill see that the sizechanged event is raised once during start.
After that if you resize the application nothing is raised anymore...

<Window x:Class="Window1"
    xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
    xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
    xmlns:docking="http://schemas.actiprosoftware.com/winfx/xaml/docking"
    xmlns:ribbon="http://schemas.actiprosoftware.com/winfx/xaml/ribbon"
    xmlns:shared="http://schemas.actiprosoftware.com/winfx/xaml/shared"
        xmlns:loc="clr-namespace:WpfApplication1"

    Title="Window1" Height="300" Width="450">
    <DockPanel>
        <docking:DockSite x:Name="MainDockSite" >
            <docking:Workspace  HorizontalAlignment="Stretch" >
                <docking:TabbedMdiHost Name="MDIPresentationsWindow" >
                    <docking:TabbedMdiContainer Name="MDITabContainer" >
                        <docking:DocumentWindow Name="DocWIndowPage1" Title="Page1">
                            <!--<loc:UserControl1 x:Name="AA"></loc:UserControl1>-->
                        </docking:DocumentWindow>
                    </docking:TabbedMdiContainer>
                </docking:TabbedMdiHost>
            </docking:Workspace>
        </docking:DockSite>
    </DockPanel>
</Window>

Imports ActiproSoftware.Windows.Controls.Docking

Class Window1

  Public Sub New()

    ' This call is required by the Windows Form Designer.
    InitializeComponent()

  End Sub


  Private Sub DocWIndowPage1_SizeChanged(ByVal sender As Object, ByVal e As System.Windows.SizeChangedEventArgs) Handles DocWIndowPage1.SizeChanged
    Dim b As Boolean = True 'is only fired once....
  End Sub
End Class

Comments (1)

Posted 9 years ago by Actipro Software Support - Cleveland, OH, USA
Avatar
The DocumentWindow is represented by the "tab" portion of the UI. Therefore SizeChanged will only fire on it when the tab is resized.

You'd want to attach your SizeChanged event handler to your UserControl1 instance instead, since it is the root content element of the document window.


Actipro Software Support

The latest build of this product (v2018.1 build 0675) was released 1 month ago, which was after the last post in this thread.

Add Comment

Please log in to a validated account to post comments.