0

Here is my sample code. What is wrong with this? When I move the grid splitter, it is moving in opposite direction.

<Grid Grid.Row="2" Grid.Column="2">

    <Grid.RowDefinitions>
        <RowDefinition MinHeight="400" Height="*"/>
        <RowDefinition Height="5"/>
        <RowDefinition MinHeight="200" Height="Auto"/>
    </Grid.RowDefinitions>

    <ContentControl cal:RegionManager.RegionName="MainWorkAreaRegion" DockPanel.Dock="Right" FocusVisualStyle="{DynamicResource ControlFocusVisualStyle}"  />
    <!--<Separator Grid.Row="1" Height="2"  HorizontalAlignment="Stretch" Margin="-2,0" Style="{StaticResource {x:Static ToolBar.SeparatorStyleKey}}" Background="#7F7F7F"/>-->
    <GridSplitter Grid.Row="1" Height="2"   HorizontalAlignment="Stretch" VerticalAlignment="Top" Background="#7F7F7F"/>
    <!--<GridSplitter Grid.Column="0" Height="5"   Grid.RowSpan="1" HorizontalAlignment="Stretch" VerticalAlignment="Top"/>-->
    <ContentControl cal:RegionManager.RegionName="LoggedEventAreaRegion" DockPanel.Dock="Right" FocusVisualStyle="{DynamicResource ControlFocusVisualStyle}"  Grid.Row="2"/>

</Grid>
Petter Hesselberg
  • 5,062
  • 2
  • 24
  • 42
  • Try to play with `GridSplitter.ResizeBehavior`. Would be nice to see visualization of the problem (see [my question](http://stackoverflow.com/q/36915180/1997232) on related problem). – Sinatr Dec 07 '16 at 14:36

1 Answers1

0

Remove the VerticalAlignment="Top" attribute to restore the default GridSplitter behaviour.

<GridSplitter Grid.Row="1" Height="2" HorizontalAlignment="Stretch" Background="#7F7F7F"/>

Alternatively, you can change the values of the ResizeDirection or ResizeBehavior attributes to achieve the desired behaviour .

Jamleck
  • 1,017
  • 7
  • 12