0
I’m trying to center vertically on one label
within a StackPanel
. I’ve already defined the attribute VerticalAlignment="Center"
but I didn’t notice any difference in vertical positioning, as can be seen in the image below. That is, the label remains aligned to the top.
Also follows the XAML
:
<UserControl x:Class="FoxCcoManagerMainScreen.FixedHeaderControl"
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
xmlns:local="clr-namespace:FoxCcoManagerMainScreen"
mc:Ignorable="d" Width="405" Height="77.5">
<StackPanel Orientation="Vertical">
<Rectangle Height="45" Stroke="Black" Fill="#FFFF7400"/>
<StackPanel Height="30" Background="#FF1B1B1B">
<Label x:Name="label" Content="Home" VerticalAlignment="Center" Height="25" Margin="10,0,0,0" FontFamily="Segoe WP" FontSize="13.333" Foreground="White" HorizontalAlignment="Left" Width="50"/>
</StackPanel>
</StackPanel>
</UserControl>