Update
See this discussion for an interesting approach.
See this question
The style being created is intended only for control, and not for elements that are produced from Control. When you do not set x: Key, you implicitly set x: Key in TargetType, therefore, if TargetType = "Control", then x: Key = "Control". I do not think there is any direct way to achieve this.
Your options
<Style x:Key="ControlBaseStyle" TargetType="Control"> <Setter Property="Margin" Value="1"/> <Setter Property="Padding" Value="0"/> </Style>
Aim all buttons and ComboBoxes e.g.
<Style TargetType="{x:Type Button}" BasedOn="{StaticResource ControlBaseStyle}"/> <Style TargetType="{x:Type ComboBox}" BasedOn="{StaticResource ControlBaseStyle}"/>
or use the style directly on the control
<Button Style="{StaticResource ControlBaseStyle}" ...> <ComboBox Style="{StaticResource ControlBaseStyle}" ...>
source share