Description
-
.NET Core Version: 3.0 Preview 8
-
Windows version: Windows 10
-
Does the bug reproduce also in WPF for .NET Framework 4.8?: Not sure
Problem description:
I have a window with a grid with 2 rows. Between the rows I have a grid splitter. I want the bottom row to start with an initial height, but allow user to expand it. Both rows can collapse to height 0 or expand to fill the entire window.
When I drag the grid splitter to the top edge and continue dragging the mouse (without releasing the button) the bottom row keeps expanding for ever. I expect the gird splitter to stop expanding the bottom row as soon as the splitter hits the top of the window.
When I drag the grid splitter down it works correctly.
Actual behavior:
When I drag the grid splitter to the top edge and continue dragging the mouse (without releasing the button) the bottom row keeps expanding for ever.
Expected behavior:
I expect the gird splitter to stop expanding the bottom row as soon as the splitter hits the top of the window.
Minimal repro:
Create a new WPF app with this xaml:
<Window x:Class="WpfSplitterApp1.MainWindow"
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
xmlns:local="clr-namespace:WpfSplitterApp1"
mc:Ignorable="d"
Title="MainWindow" Height="450" Width="800">
<Grid>
<Grid.RowDefinitions>
<RowDefinition />
<RowDefinition Height="60" />
</Grid.RowDefinitions>
<Grid Grid.Row="0">
<TextBox x:Name="tb1" AcceptsReturn="True" Margin="10" Background="LightCyan" VerticalScrollBarVisibility="Visible"
Text="{Binding ActualHeight, Mode=OneWay, RelativeSource={RelativeSource Self}}"/>
</Grid>
<GridSplitter Grid.Row="0" HorizontalAlignment="Stretch" VerticalAlignment="Bottom" Height="6"/>
<Grid Grid.Row="1">
<TextBox x:Name="tb2" AcceptsReturn="True" Margin="10" Background="LightGreen" VerticalScrollBarVisibility="Visible"
Text="{Binding ActualHeight, Mode=OneWay, RelativeSource={RelativeSource Self}}"/>
</Grid>
</Grid>
</Window>
Run the application and move/size the application window so you can test dragging the grid splitter from its location to a point above the window.
Expand the grid splitter up and continue beyond window. The height is displayed in the text box. You will see it increasing.