LineStyle

800
2
01-01-2013 05:18 AM
Labels (1)
TalShapiro
New Contributor
Hello,

I'm using a SimpleLineSymbol with a custom ControlTemplate.
How can I apply LineStyle (taken from the symbol's Style property) to the Path in my ControlTemplate?
Could you share the SimpleLineSymbol default ControlTemplate?

Many thanks!
0 Kudos
2 Replies
DominiqueBroux
Esri Frequent Contributor
How can I apply LineStyle (taken from the symbol's Style property) to the Path in my ControlTemplate?
Could you share the SimpleLineSymbol default ControlTemplate?


You need to set the Path.StrokeDashArray property depending on the expected style.

Here is a sample for the dash style:
<ControlTemplate>
    <Path x:Name="Element"
        Stroke="{Binding Symbol.Color}"
       StrokeThickness="{Binding Symbol.Width}"
        StrokeDashCap="Flat"
        StrokeStartLineCap="Flat"
        StrokeEndLineCap="Flat"
        StrokeLineJoin="Round"
        StrokeDashArray="5,1" />
</ControlTemplate>
 
0 Kudos
TalShapiro
New Contributor
Ok, thanks.
Will set my own StrokeDashArray values based on the enum value using triggers/converter.
0 Kudos