我正在尝试修剪按钮中的文本,当它很长时,但它不起作用。这是我的按钮:
<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>