<Style TargetType="{x:Type TextBlock}">
<Setter Property="Margin" Value="2"/>
<Setter Property="FontSize" Value="15"/>
</Style>
项目中的DatePicker控件字体也受影响了,为DatePicker控件指定style ,都没用,求解!
这样是没问题,但是项目中太多TextBlock , 每个都加上Style, 太麻烦了,有没有办法让DatePicker 在有Style的情况下也能改变字体
追答给DatePicker写个Style不行吗?
追问试了, 不行呢。
追答试了一下,重写DatePicker应该更麻烦一些,不仅如此,还得重写Calendar,还不如就对TextBlock指定Key了,总之我觉得你使用全局的TextBlock这个用法有问题,因为会影响其它的很多控件