我在父容器中有2个文本块,并且当容器尺寸减小时,我希望在第二个文本块内容之后显示椭圆。
答案 0 :(得分:0)
您可以使用网格:
<Grid>
<Grid.ColumnDefinitions>
<ColumnDefinition Width="Auto" />
<ColumnDefinition />
</Grid.ColumnDefinitions>
<TextBlock Grid.Column="0" Text="This is the first TextBlock. " />
<TextBlock Grid.Column="1" Text="This is the second TextBlock. " TextTrimming="CharacterEllipsis" />
</Grid>
结果: