I have a simple Window
that looks like this:
<Window x:Class="StackOverflowExample.MainWindow"
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
Title="MainWindow" Height="350" Width="525">
<Grid>
<Grid.RowDefinitions>
<RowDefinition Height="3*" />
<RowDefinition Height="2*" />
</Grid.RowDefinitions>
<Label Content="Foo" Margin="5" />
<Label Grid.Row="1" Content="Bar" Margin="5" />
<GridSplitter Grid.Row="1" Background="Black" VerticalAlignment="Top" Height="5" />
</Grid>
</Window>
// The code-behind is empty, except for "InitializeComponent()".
When I run the application, however, no GridSplitter
is visible. I also see no GridSplitter
during design time.
- I've made sure that the
GridSplitter
is in the correct row, and set theVerticalAlignment
toTop
- I've specified an explicit background color to make sure that the
GridSplitter
does not blend in. - I've made sure that the
GridSplitter
is the last element in theGrid
, so I shouldn't be running intoZIndex
problems. - Just in case, I've added margins to the Labels to make sure that they are not obscuring the grid (although this should make a difference in this case).
What am I doing wrong?