I have this generic style for a custom control with this Template.
<Style TargetType="{x:Type local:MyType}">
<Setter Property="Template">
<Setter.Value>
<ControlTemplate TargetType="{x:Type local:MyType}">
<Border Background="{TemplateBinding Background}" BorderBrush="{TemplateBinding BorderBrush}" BorderThickness="{TemplateBinding BorderThickness}">
<local:MyControl />
</Border>
...
if this control is used in a project where is this style globaly set:
<Style TargetType="{x:Type Border}">
<Setter Property="Padding" Value="3" />
<Setter Property="VerticalAlignment" Value="Top" />
</Style>
But MyControl is an ordinary UserControl containing:
...
<Border .. />
Then the Border in the UserControl (residing in the Template) inherits this style as well (Padding 3 etc.)
Is there any way to say the controls in the ControlTemplate not to inhertit these global styles?
Just to mention. It is a Generic Template