Select to view content in your preferred language

Unique Value Renderer adn Selected States.

891
2
02-11-2011 08:24 AM
JayKappy
Frequent Contributor
I KNOW this seems long post here but simply looking to know if this is possible OR NOT....just a little push in the right direction....
I had some points that were created in a graphics layer via a query.
Using an ESRI example I set them to:
<esri:MarkerSymbol x:Key="StrobeMarkerSymbol_Blue">
selectedGraphic.Symbol = TryCast(LayoutRoot.Resources("StrobeMarkerSymbol_Blue"), ESRI.ArcGIS.Client.Symbols.Symbol)


In this MarkerSymbol there were states SELECTED and UNSELECTED which I set based off of a selection change in a Listbox...if clicked inteh listbox if chages teh SLECTION status of that graphic to SELECT and then it pulses lieka strobe.
   Private Sub imageListBuffer_SelectionChanged(ByVal sender As Object, ByVal e As SelectionChangedEventArgs)
        ' MyMap.PanTo(TryCast(imageList.SelectedItem, Graphic).Geometry)

        For Each item As Graphic In e.RemovedItems
            Dim g As Graphic = TryCast(item, Graphic)
            g.UnSelect()
        Next
        For Each item As Graphic In e.AddedItems
            Dim g As Graphic = TryCast(item, Graphic)
            g.[Select]()
        Next
    End Sub


I then eliminated the line of code that sets the graphics to "StrobeMarkerSymbol" and pointed them to a unique value renderer to render the graphics to different symbology based on value.
My question is now that I lost the Strobe effect.....can I get it back
Can I set up a visual state manager in a UniqueValueRenderer?

CAN I set up a Selected State insode the UniqueValueRenderer????
 
<esri:MarkerSymbol x:Key="StrobeMarkerSymbol_Red">
   <esri:MarkerSymbol.ControlTemplate>
        <ControlTemplate>
             <Canvas>
                  <VisualStateManager.VisualStateGroups>   
                        <VisualStateGroup x:Name="SelectionStates">                                
                             <VisualState x:Name="Selected">                                   
                                  <Storyboard RepeatBehavior="ForEver">
                                   <DoubleAnimation BeginTime="0"
                                          Storyboard.TargetName="ellipse" Storyboard.TargetProperty="(UIElement.RenderTransform).(ScaleTransform.ScaleX)"
                              From="1" To="10" Duration="00:00:01" />
                                   <DoubleAnimation BeginTime="0"
                              Storyboard.TargetName="ellipse" Storyboard.TargetProperty="(UIElement.RenderTransform).(ScaleTransform.ScaleY)"
                              From="1" To="10" Duration="00:00:01" />
                                   <DoubleAnimation BeginTime="0"
 Storyboard.TargetName="ellipse" Storyboard.TargetProperty="(UIElement.Opacity)"
                              From="1" To="0" Duration="00:00:01" />
                                   </Storyboard>
                              </VisualState>
                            <Ellipse Height="10" Width="10" Canvas.Left="-5" Canvas.Top="-5" 
                     RenderTransformOrigin="0.5,0.5" x:Name="ellipse"
            IsHitTestVisible="False">
                                <Ellipse.RenderTransform>
                                    <ScaleTransform />
                                </Ellipse.RenderTransform>
                                <Ellipse.Fill>
                                    <RadialGradientBrush>
                                        <GradientStop Color="#00FF0000" />
                                        <GradientStop Color="#FFFF0000" Offset="0.25"/>
                                        <GradientStop Color="#00FF0000" Offset="0.5"/>
                                        <GradientStop Color="#FFFF0000" Offset="0.75"/>
                                        <GradientStop Color="#00FF0000" Offset="1"/>
                                    </RadialGradientBrush>
                                </Ellipse.Fill>
                            </Ellipse>
                            <Ellipse Height="10" Width="10" Canvas.Left="-5" Canvas.Top="-5" 
               Fill="#FFFF0000" x:Name="ellipse1"/>
                        </Canvas>
                    </ControlTemplate>
                </esri:MarkerSymbol.ControlTemplate>
            </esri:MarkerSymbol>


            <esri:SimpleMarkerSymbol x:Key="BLUEMarkerSymbol" Color="Blue" Size="12" Style="Circle" />
            <esri:SimpleMarkerSymbol x:Key="PURPLEMarkerSymbol" Color="Purple" Size="12" Style="Circle" />

            <esri:UniqueValueRenderer x:Key="MyUniqueValueRenderer" Attribute="TYPE" DefaultSymbol="{StaticResource BLUEMarkerSymbol}">
                <esri:UniqueValueRenderer.Infos>
                    <esri:UniqueValueInfo Value="Church" Symbol="{StaticResource BLUEMarkerSymbol}" />
                    <esri:UniqueValueInfo Value="SCHOOL" Symbol="{StaticResource PURPLEMarkerSymbol}" />
                </esri:UniqueValueRenderer.Infos>
            </esri:UniqueValueRenderer>
0 Kudos
2 Replies
JenniferNery
Esri Regular Contributor
Instead of using SimpleMarkerSymbols as symbol for your UniqueValueRenderer Infos, you can use StrobeMarkerSymbols. But maybe change the Fill color of the ellipse (marked as static symbol on top in the sample) to differentiate the symbols.
0 Kudos
JayKappy
Frequent Contributor
Daahhhhh on my part totally....Gosh I feel embarassed....sorry for wasting your time with a question like that....
The unique renderer simple splits the values and then assigns the Symbol....gosh...lol
Sorry again and thanks...
0 Kudos