是否可以在 XAML 中为 CSS 中的图像执行类似 ffloat:left 的操作。我需要创建这样的东西:
具有可变图像尺寸和文本长度。
编辑:在我的例子中,图像周围的文本扭曲不是静态的,它是在返回 TextBlock 元素列表(带有运行)的 C# 代码中创建的
最佳答案
在 Silverlight 4 中,您可以使用 RichTextBox
实现此目的:
<RichTextBox TextWrapping="Wrap" IsReadOnly="False">
<Paragraph>
More text here ..
<InlineUIContainer>
<Image Source="abc.jpg"/>
</InlineUIContainer>
more and more text here;
<LineBreak />
</Paragraph>
</RichTextBox>
看起来 Win8 Metro 有一个 RichTextBox , 还有一个 InlineUIContainer ,所以像上面这样的东西应该可以工作!
关于c# - 如何在 XAML 中处理 "float"图像 (Windows 8 Metro),我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/10445571/