In a xaml DataTemplate
I have
<DockPanel >
<StackPanel DockPanel.Dock="Right" Orientation="Vertical">
<Button />
<Button />
</StackPanel>
<Grid VerticalAlignment="Stretch/Center">
<TextBlock HorizontalAlignment="Stretch"
TextAlignment="Right"
Text="{Binding ...}"
VerticalAlignment="Stretch"
DockPanel.Dock="Right"/>
</Grid>
</DockPanel>
The dockpanel is horizontal, i.e. stackpanel is to the right, the grid to the left.
I need the two buttons to stretch each to 50% of the vertical space of height of the dockpanel. How do I do it?
A schematic picture of want I try to achieve. The controls are meant to stretch to the borders as much as possible.
I need the textblock to stretch to 100% of the vertical space of height of the dockpanel and it's text to be vertically centered. It doesn't work bc. in the case of Strech I get the 100% space but the text is vertically topped and in the case of Center the textblock is not stretched.