Select to view content in your preferred language

rotate graphics on the map based on an attribute

632
1
09-28-2010 07:48 AM
MannusEtten
Emerging Contributor
I read that using special dictionary converters are not necessary in SL4 with the ESRI controls. Nice news. So now I made my own simplelinesymbol. See code:

            <esriSymbols:SimpleLineSymbol x:Key="rotateLineSymbol">
                <esriSymbols:SimpleLineSymbol.ControlTemplate>
                    <ControlTemplate>
                        <Grid x:Name="grid" RenderTransformOrigin="0.5,0.5">
                            <Grid.RenderTransform>
                                <RotateTransform Angle="{Binding Path=Attributes, ElementName=hoek}"/>
                            </Grid.RenderTransform>
                        </Grid>
                    </ControlTemplate>
                </esriSymbols:SimpleLineSymbol.ControlTemplate>
            </esriSymbols:SimpleLineSymbol>


This symbol must be rotated by a value of the attribute "Hoek". So I used binding to bind the property angle of the rotatetransform to the collection of attributes of one graphic.

I doesn't work so probably there is no graphic connected to the symbol? How can I realize my functionality?
0 Kudos
1 Reply
DominiqueBroux
Esri Frequent Contributor
From SL4, you can access items of a dictionary by using the notation [<key>].

In your case, the binding should be:
"{Binding Path=Attributes[Hoek]}"
0 Kudos