【发布时间】:2014-03-04 08:36:16
【问题描述】:
我正在尝试为 Silverlight/XAML/C# 中的标签控件定义样式。
我是新手,所以请原谅我的无知。
当我编写以下代码时,IDE 显示标签 在 silverlight 项目中支持
那么我该如何为这个标签定义一个样式类型呢?
<ResourceDictionary
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml">
...
<Style x:Key="TitleFontStyle" TargetType="sdk:Label">
<Setter Property="Background" Value="{StaticResource ButtonBackgroundGradientBrush}" />
</Style>
</ResourceDictionary>
【问题讨论】:
-
我刚刚注意到还有一个 TextBlock ? Label 和 TextBlock 有什么区别?
-
True 我现在正在使用 TextBlock。两者兼得几乎毫无意义。
-
其实我找到了这个帖子stackoverflow.com/questions/5382925/…
标签: silverlight xaml silverlight-5.0 blend