Style inheritance
A style in WPF can base on another style. This allows you to specify a base style that sets common properties and derive from it for specialized controls.<Style x:Key="baseStyle" TargetType="TextBlock"> <Setter Property="FontSize" Value="12" /> <Setter Property="Background" Value="Orange" /> </Style> <Style x:Key="boldStyle" BasedOn="{StaticResource baseStyle}" TargetType="TextBlock"> <Setter Property="FontWeight" Value="Bold" /> </Style>
No comments:
Post a Comment