【发布时间】:2015-03-26 11:23:45
【问题描述】:
为什么会这样:
<StackPanel TextBlock.FontWeight="Bold">
<!-- All text boxes inside have their text in bold -->
<TextBox Width="100" Height="24" Text="AaBbCc" />
</StackPanel>
这不是吗?
<StackPanel TextBox.TextDecorations="Underline">
<TextBox Width="100" Height="24" Text="AaBbCc" />
</StackPanel>
error MC3015: The attached property 'TextBox.TextDecorations' is not defined on 'StackPanel' or one of its base classes.
但是FontWeight 属性也没有在StackPanel 上定义!那么为什么它们的行为不同呢?
【问题讨论】:
-
TextBlock.TextDecorations="Underline" 怎么样???您在第一段代码中使用了它。
标签: wpf dependency-properties attached-properties