Quantcast
Channel: Windows Presentation Foundation (WPF) forum
Viewing all articles
Browse latest Browse all 18858

while Inherit style in WPF it affect parent style

$
0
0
<StyleTargetType="local:CustomControl"><Setter Property="Background" Value="Transparent"/><Setter Property="BorderBrush" Value="Gray"/><Setter Property="BorderThickness" Value="0,0,0,1"/><Setter Property="Padding" Value="3,0,3,0"/><Setter Property="IsTabStop" Value="False"/><Setter Property="VerticalContentAlignment" Value="Center"/></Style>

Now i need to override customcontrol border for some other place like below,

<StyleTargetType="local:CustomControl"BasedOn="{StaticResource  {x:Type local:CustomControl}}"><Setter Property="BorderThickness" Value="1"/></Style>

My problem is when i am using above code it override the 1st written code. is my code is correct.

Note: the base style is only written with target type. i need to override that control border in some other place without affect base code.

is it possible ? please help me to resolve this problem.

thanks in advance.


Viewing all articles
Browse latest Browse all 18858

Trending Articles