关于WPF Style 复用的问题

 <StackPanel.Resources>
            <Style x:Key="ControlBaseStyle" TargetType="{x:Type FrameworkElement}">
                <Setter Property="Margin" Value="55,0,0,0" />
            </Style>
            <Style TargetType="{x:Type TextBlock}" BasedOn="{StaticResource ControlBaseStyle}"/>
        </StackPanel.Resources>

以上代码能实现多种控件之间的Margin这种常用属性的复用

原文地址:https://www.cnblogs.com/xiaomaogong/p/3492871.html