xaml - UWP 中的 TextBlock 背景属性去哪儿了?

标签 xaml uwp

我需要在 UWP 中更改 TextBlock 的背景,但背景属性不再存在。解决这个问题的方法是什么?

这行不通...

                    <TextBlock Text="Exceptions Log"
                               FontSize="10"
                               Background="Red" // This is invalid
                               />

谢谢

最佳答案

只需将它放在网格或边框或其他东西中......

<Border Background="Red">
    <TextBlock Text="Exceptions Log"
               FontSize="10" />
</Border>

关于xaml - UWP 中的 TextBlock 背景属性去哪儿了?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/34131831/

相关文章:

c# - 使用 ContentPresenter 和 ItemsPresenter 的自定义控件

xaml - 如何在 Windows 10 UWP 应用程序中将 SourceUri BitmapIcon 绑定(bind)到 RadioButton

uwp - 在 UWP 中旋转、缩放和平移元素

c# - UWP Webview 仅触发最后一个请求的 NavigationCompleted 事件

c# - UWP GridView 图像拉伸(stretch)错误

c# - Xaml 中的展开/折叠菜单

silverlight - 定义剪切 Silverlight 网格控件行的顺序

c# - UWP 应用程序中是否有 Attribute.IsDefined 的替代品?

xaml - 在 UWP 10 应用中使用 <Interaction.Behaviors> 和 <EventTriggerBehavior>

WPF 选项卡样式