I create a style for Path in resource dictionary as below:
<Style x:Key="HeaderPathStyle" TargetType="Path">
<Setter Property="Opacity" Value="0.8"/>
<Setter Property="HorizontalAlignment" Value="Stretch"/>
<Setter Property="VerticalAlignment" Value="Stretch"/>
<Setter Property="Stretch" Value="Fill"/>
<Setter Property="StrokeThickness" Value="0.5"/>
<Setter Property="Data" Value="M12.5,7 C47.333332,7 115.85664,7 117,7 C118.14336,7 122.1255,6.7291665 122.25,12 C122.3745,17.270834 122.25,18.333334 122.25,21.5 L12.5,21.5 z"/>
<Setter Property="Fill">
<Setter.Value>
<RadialGradientBrush GradientOrigin="0.699000000953674,0.792999982833862">
<RadialGradientBrush.RelativeTransform>
<TransformGroup>
<ScaleTransform CenterX="0.5" CenterY="0.5" ScaleX="1.4" ScaleY="2.188"/>
<SkewTransform CenterX="0.5" CenterY="0.5"/>
<RotateTransform CenterX="0.5" CenterY="0.5"/>
<TranslateTransform X="0.017" Y="0.009"/>
</TransformGroup>
</RadialGradientBrush.RelativeTransform>
<GradientStop Color="#FF6C6C8E" Offset="1"/>
<GradientStop Color="#FFADD8E6" Offset="0"/>
</RadialGradientBrush>
</Setter.Value>
</Setter>
</Style>
Then use it usercontrol as below:
<Path Style="{StaticResource HeaderPathStyle}"/>
But I get error. If I set Path in user control xaml directly with same setting, no error. How to fix it?