我有一个接近下面的代码的扩展器的自定义模板。 我不得不改变一些代码来取出自定义类,画笔等。 <Style TargetType="{x:Type Expander}"> <Setter Property="HorizontalContentAlignment" Value="Stretch" /> <Setter Property="VerticalContentAlignment" Value="Top" /> <Setter Property="BorderBrush" Value="Transparent" /> <Setter Property="FontFamily" Value="Tahoma" /> <Setter Property="FontSize" Value="12" /> <Setter Property="Foreground" Value="Black" /> <Setter Property="BorderThickness" Value="1" /> <Setter Property="Margin" Value="2,0,0,0" /> <Setter Property="Template"> <Setter.Value> <ControlTemplate TargetType="{x:Type Expander}"> <Border x:Name="Border" SnapsToDevicePixels="true" Background="White" BorderBrush="{TemplateBinding BorderBrush}" BorderThickness="{TemplateBinding BorderThickness}" Margin="0,0,0,10" Padding="0" CornerRadius="8"> <DockPanel> […]