I am facing some weird resizing when placing a TextBox in a StackPanel inside a ScrollViewer with horizontal scrolling.
Elements in the StackPanel should stretch to the full width of the grid column. The grid column should occupy half the window.
All siblings that appear after the TextBox do not resize when the window is resized.
Here is a simplified version of my code that reproduces the problem:
<ScrollViewer HorizontalScrollBarVisibility="Auto">
<Grid>
<StackPanel Background="Gray" Grid.Column="0">
<Border Background="Blue" Height="40"/>
<TextBox/>
<Border Background="RoyalBlue" Height="40"/>
<Border Background="Red" Height="40"/>
</StackPanel>
<Grid.ColumnDefinitions>
<ColumnDefinition Width="*" />
<ColumnDefinition Width="*" />
</Grid.ColumnDefinitions>
</Grid>
</ScrollViewer>
This is what xaml displays correctly in Windows 10:

If I resize the window, the elements that appear after the TextBox will not resize correctly. If you keep trying several times, they are fixed.

TextBox Border, . TextBox - , . Number.
HorizontalScrollBarVisibility="Auto" ScrollViewer, . , , . ScrollViewer, .