Reputation: 215
I am trying to increase the height of a row in my grid to the number of items I add in XAML, I'll draw it out to explain and hopefully someone can help me with my problem:
Upvotes: 0
Views: 136
Reputation: 3375
How about:
<Grid>
<Grid.RowDefinitions>
<RowDefinition Height="43"/>
<RowDefinition Height="Auto"/>
<RowDefinition Height="54"/>
</Grid.RowDefinitions>
<Button Grid.Row="0" Content="Title"/>
<StackPanel Grid.Row="1" Orientation="Vertical">
<TextBlock Text="Scenario 1" />
<TextBlock Text="Scenario 2" />
<TextBlock Text="Scenario 3" />
</StackPanel>
<Button Grid.Row="2" Content="Add scenario"/>
</Grid>
This will not grow the window, but just the Grid itself.
Upvotes: 1