一、隐式写法

<Style TargetType="TextBlock">
<Setter Property="FontSize" Value="28"/>
</Style>
<Style TargetType="{x:Type TextBlock}">
<Setter Property="FontSize" Value="28"/>
</Style>

二、显示写法

<Style x:Key="cc" TargetType="{x:Type TextBlock}">
      <Setter Property="FontSize" Value="28"/>
</Style>

三、自动应用写法

<Style x:Key="{x:Type TextBlock}" TargetType="TextBlock">
   <Setter Property="FontSize" Value="28"/>
</Style>

四、内部写法(写在内部,“.”分割)

<Style x:Key="aa">
  <Setter Property="Control.FontSize" Value="28"/>
</Style>

 

相关文章:

  • 2022-12-23
  • 2021-08-03
  • 2021-05-24
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
猜你喜欢
  • 2022-12-23
  • 2022-12-23
  • 2021-06-24
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
相关资源
相似解决方案