Выровнять TextBlock внутри ListBoxItem - PullRequest
0 голосов
/ 11 апреля 2011

Я занимаюсь разработкой приложения для Windows Phone 7 .

Я хочу центрировать текстовый блок вертикально внутри ListBoxItem. Вот мой код XAML:

<ListBoxItem x:Name="SingleGameItem" Height="79" Margin="10,5">
    <TextBlock HorizontalAlignment="Center" Height="31" Margin="5" TextWrapping="Wrap" Text="TextBlock" VerticalAlignment="Center" Width="431" TextAlignment="Center"/>
</ListBoxItem>

Как я могу это сделать?

1 Ответ

0 голосов
/ 11 апреля 2011

Решение:

<ListBox x:Name="Options" Margin="12,8,8,8" Grid.Row="1">
    <ListBoxItem x:Name="SingleGameItem" Height="79" Margin="10,5" VerticalAlignment="Center">
        <TextBlock HorizontalAlignment="Center" Height="31" Margin="5" TextWrapping="Wrap" Text="TextBlock" VerticalAlignment="Center" Width="431" TextAlignment="Center"/>
    </ListBoxItem>
</ListBox>

К сожалению.

...