按钮中的文本修剪

时间:2014-03-05 10:31:28

标签: xaml button windows-phone-8 texttrimming

我正在尝试修剪按钮中的文本,当它很长时,但它不起作用。这是我的按钮:

    <Button x:Name="button" Margin="-6,0,-6,0" HorizontalAlignment="Stretch" IsEnabled="{Binding Path=Enabled}" Click="button_Clicked" Style="{StaticResource ButtonInputButtonStyle}">
    <StackPanel Orientation="Horizontal" Margin="0, 0, 0, 0">
        <Image x:Name="buttonImage" Visibility="Collapsed" Stretch="Uniform" Margin="0, 0, 0, 0" VerticalAlignment="Center"/>
        <TextBlock x:Name="buttonTextBlock" Text="{Binding Path=Label, Mode=OneWay}" VerticalAlignment="Center" Margin="0, 0, 0, 0" TextTrimming="WordEllipsis" TextWrapping="NoWrap"/>
    </StackPanel>
    </Button>

0 个答案:

没有答案