1

________________
__________
项目1____________ __________Imemnumber2_____ __________项目
3____________
__________________________

<Grid x:Name="ContentPanel" Grid.Row="1" Margin="12,0,12,0">
            <ListBox x:Name="MainListBox" HorizontalAlignment="Center" VerticalAlignment="Center" Margin="0,0,-12,0" ItemsSource="{Binding Items}" SelectionChanged="MainListBox_SelectionChanged" >
                <ListBox.ItemTemplate>
                    <DataTemplate>
                        <StackPanel  Margin="10">
                            <Image Source="{Binding Image}" Stretch="None"/>
                            <TextBlock Text="{Binding Title}" TextWrapping="Wrap" Style="{StaticResource PhoneTextExtraLargeStyle}"/>
                        </StackPanel>
                    </DataTemplate>
                </ListBox.ItemTemplate>
            </ListBox>
        </Grid>

我怎样才能做到这一点?

_______________________
___________
项目1_____________ _________Imemnumber2________ ___________项目
3_____________
____________________________

4

1 回答 1

0

尝试设置 TextBox 的 TextAlignment 属性

<TextBlock Text="{Binding Title}" TextWrapping="Wrap" Style="{StaticResource PhoneTextExtraLargeStyle}" TextAlignment="Center"/>

更新:

尝试固定 TextBlock 的宽度,如下所示

<TextBlock Text="{Binding Title}" TextWrapping="Wrap" Style="{StaticResource PhoneTextExtraLargeStyle}" TextAlignment="Center" Width="400"/>
于 2012-12-14T13:24:29.587 回答