【发布时间】:2011-08-13 06:47:57
【问题描述】:
在 Silverlight 4(使用 Expression Blend 4)中,如何在包含 Border 的样式中更改 TextBox 的字体大小?我正在将样式从 WPF 转换为 Silverlight(总是很有趣)。这是我所拥有的:
<Style x:Key="Title" TargetType="Border">
<Setter Property="TextBlock.VerticalAlignment" Value="Center"/>
<Setter Property="TextBlock.TextAlignment" Value="Center"/>
<Setter Property="TextBlock.FontSize" Value="48"/>
<Setter Property="TextBlock.Foreground" Value="{StaticResource TextForeground}"/>
<Setter Property="VerticalAlignment" Value="Top"/>
<Setter Property="HorizontalAlignment" Value="Stretch"/>
<Setter Property="Background" Value="{StaticResource TitleBackground}"/>
<Setter Property="Padding" Value="25,0"/>
</Style>
它不工作。它在设计器中给了我以下异常:
编辑:
好的,我知道这在 WPF 中是可能的。这在 Silverlight 中是不可能的吗(不采用 Xin 建议的整个主题构造?)
【问题讨论】:
-
我认为在 Silverlight 4 中不可能做到这一点...
-
@Xin,不是很有帮助,但很诚实。谢谢:)
标签: silverlight styles