如果您运行此代码并最小化/最大化窗口的宽度
<TextBlock TextTrimming="WordEllipsis" >
<Run Text="I want that this rectangle will be placed "/>
<Rectangle Fill="Black" Width="20" Height="10" />
<Run Text=" here when I minimize width of the window"/>
</TextBlock>
您将看到 Rectange 将移至左侧。
WPF中有错误吗?