优先级问题吧,如果你在Style中再添加一个属性,如:
<Style TargetType="TextBox">
<Setter Property="Text" Value="{Binding Source={StaticResource person1}, Path=Age, UpdateSourceTrigger=PropertyChanged}"/>
<Setter Property="FontWeight" Value="Bold"/>
</Style>
如果你的textbox1不设置FontWeight,其FontWeight值就会用Style中的Bold,如果你textbox1的FontWeight设为Light,就会用Light,而不会用Bold。
<Style TargetType="TextBox">
<Setter Property="Text" Value="{Binding Source={StaticResource person1}, Path=Age, UpdateSourceTrigger=PropertyChanged}"/>
<Setter Property="FontWeight" Value="Bold"/>
</Style>
如果你的textbox1不设置FontWeight,其FontWeight值就会用Style中的Bold,如果你textbox1的FontWeight设为Light,就会用Light,而不会用Bold。
解决方案 »
免费领取超大流量手机卡,每月29元包185G流量+100分钟通话, 中国电信官方发货