【发布时间】:2017-01-10 03:08:39
【问题描述】:
我使用ImageBrush 作为Textblock Foreground。它工作正常,但是当Textblock 是Underline 时,该行不显示。
复制。在 XAML 中
<TextBlock x:Name="textBlock" FontSize="80" FontWeight="Bold">
<Underline>This is my text</Underline>
</TextBlock>
在后面的代码中
Uri uri = new Uri("ms-appx:///Assets/0.png");
BitmapImage bmp = new BitmapImage(uri);
ImageBrush imageBrush = new ImageBrush();
imageBrush.ImageSource = bmp;
this.textBlock.Foreground = imageBrush;
下面是应用了下划线的 SolidColorBrush 的样子
那么当ImageBrush被应用时,下划线就消失了
所以我的问题是如何在 UWP 中将 ImageBrush Foreground 应用于 Underline Textblock?
【问题讨论】:
标签: c# uwp windows-10 textblock underline