Defining in a code scale dependency and placement properties for labels

503
0
03-19-2013 07:58 AM
JoannaLaroussi
New Contributor
I have a marker symbol with labels bind to the attributes of my feature class. Is there any way to define in a code scale dependency for labels only? In some cases I have more than one feature in the same spatial location and their labels overlap. Can/how I use in a code label placement properties to solve this issue? I am using ArcGIS 10.0 and Silverlight API 2.4. Thanks for your ideas.

<esri:MarkerSymbol x:Key="MyMarkerSymbol" >
                <esri:MarkerSymbol.ControlTemplate>

                    <ControlTemplate>
                        <Grid>
                            <Rectangle x:Name="Element" Width="15" Height="15" Fill="#ff9900" Stroke="White" StrokeThickness="2" HorizontalAlignment="Center" VerticalAlignment="Center">
                                <VisualStateManager.VisualStateGroups>
                                    <VisualStateGroup x:Name="SelectionPublic">
                                        <VisualState x:Name="Unselected" />
                                        <VisualState x:Name="Selected">
                                            <Storyboard>
                                                <ColorAnimation Storyboard.TargetName="Element"
                                                Storyboard.TargetProperty="(Rectangle.Fill).(SolidColorBrush.Color)"
                                                To="Cyan" Duration="00:00:0.25"/>
                                            </Storyboard>
                                        </VisualState>
                                    </VisualStateGroup>
                                </VisualStateManager.VisualStateGroups>
                            </Rectangle>

                            <!-- lables-->
                            <Grid Margin="50,-15,0,0" HorizontalAlignment="Left" VerticalAlignment="Top" IsHitTestVisible="False"    >
                                <TextBlock Foreground="White" Text="{Binding Attributes[Code ]}"    >
                                <TextBlock.Effect>
                                    <BlurEffect Radius="5" />
                                </TextBlock.Effect>
                                </TextBlock>
                                <TextBlock Foreground="Black" Text="{Binding Attributes[Code ]}" />
                            </Grid>

                        </Grid>
                    </ControlTemplate>
                </esri:MarkerSymbol.ControlTemplate>
            </esri:MarkerSymbol>
0 Kudos
0 Replies