WindowsFormsHost does not resize the panel

Hey. I am trying to place a panel in a WindowsformsHost control as follows:

    <DockPanel LastChildFill="true" Grid.Column="1" Grid.ColumnSpan="2">
       <WindowsFormsHost Name="FormsHost" Background="Aqua" Height="{Binding ElementName=RootWindow, Path=ActualHeight}" Width="{Binding ElementName=RootWindow, Path=ActualWidth}">
            <wf:Panel Dock="Fill" x:Name="basePanel" AutoSize="True" />
        </WindowsFormsHost>
    </DockPanel>

for some reason, the panel does not resize when the application is running. Anyone got any ideas?

+3
source share

All Articles