I use WPF 4.5, Caliburn Micro 2, VS2013. I use TextBlock as item in ComboBox.
The height of ComboBox is 80.
The height of TextBlock is 50.
The font size of text inside the TextBlock is standard.
My following sample xaml code works but it shows the text not vertically centered in TextBlock. How to make the text vertically centered with/without changing the height of TextBlock to Auto? Thank you in advance.
<ComboBox Width="150"
Height="80"
VerticalContentAlignment="Center"
ItemsSource="{Binding Path=Locations}"
SelectedIndex="0"
SelectedItem="{Binding Path=SelectedLocation,
Mode=OneWayToSource}">
<ComboBox.ItemTemplate>
<DataTemplate>
<TextBlock Height="50"
HorizontalAlignment="Stretch"
VerticalAlignment="Center"
Background="Aquamarine"
Text="{Binding Path=Address}" />
</DataTemplate>
</ComboBox.ItemTemplate>
</ComboBox>
And here is the screenshot: