Thanks again....yea thats the part thats confusing me....the var in your example...is there somewhere that exaplains this statement more...the parameters item, graphic etc... For Each item As var In e.AddedItems
Dim g As Graphic = TryCast(item, Graphic)
g.[Select]()
Next
For each Items As ? , in the listbox (items that were added, or are there)Dim the graphic as the selected item in the listbox?then select it, thus resulting in the markersymbol beign called which changes the symbolozation.That about it or close?As for my project I did this....xaml
<Grid x:Name="resultsPanel" Width="200"
HorizontalAlignment="Left" VerticalAlignment="Top"
Margin="10,40,0,10">
<Border Padding="2" Style="{StaticResource darkBorder}">
<StackPanel Orientation="Vertical" >
<ListBox x:Name="imageList" Height="200" ScrollViewer.VerticalScrollBarVisibility="Visible"
BorderThickness="0"
Foreground="White" Background="Transparent"
SelectionChanged="imageList2_SelectionChanged">
<ListBox.ItemTemplate>
<DataTemplate>
<StackPanel Orientation="Horizontal" VerticalAlignment="Center" >
<StackPanel Margin="1">
<TextBlock Foreground="White" Text="{Binding Attributes[TYPE]}" />
</StackPanel>
<StackPanel Margin="5,0,0,0" Orientation="Vertical">
<TextBlock Foreground="White" Text="{Binding Attributes[CITY_NAME], StringFormat='City Name: \{0\}'}" >
<TextBlock.Effect>
<DropShadowEffect/>
</TextBlock.Effect>
</TextBlock>
</StackPanel>
</StackPanel>
</DataTemplate>
</ListBox.ItemTemplate>
</ListBox>
</StackPanel>
</Border>
</Grid>
VB - I used a query
Private Sub ExecuteList_Click(ByVal sender As Object, ByVal e As RoutedEventArgs)
'' Query task initialization
Dim queryTask As New QueryTask("http://gis.org/arcgis/rest/services/MG_Test_WGS84/MapServer/1")
AddHandler queryTask.ExecuteCompleted, AddressOf QueryTask_ExecuteCompletedListBox
AddHandler queryTask.Failed, AddressOf QueryTask_FailedSearch
Dim query As New ESRI.ArcGIS.Client.Tasks.Query()
query.OutFields.Add("*")
query.ReturnGeometry = True
query.Where = "1=1"
query.OutSpatialReference = MyMap.SpatialReference
queryTask.ExecuteAsync(query)
End Sub
Private Sub QueryTask_ExecuteCompletedListBox(ByVal sender As Object, ByVal args As ESRI.ArcGIS.Client.Tasks.QueryEventArgs)
' Set the Target Graphics Layer
Dim graphicsLayer As GraphicsLayer = TryCast(MyMap.Layers("MyGraphicsLayerListBox"), GraphicsLayer)
' Clear previous results
graphicsLayer.ClearGraphics()
' Check for new results
Dim featureSet As FeatureSet = args.FeatureSet
' Set the Source of the ListBox to the features returned by the query
imageList.ItemsSource = args.FeatureSet.Features
If featureSet.Features.Count > 0 Then
For Each resultFeature As Graphic In featureSet.Features
resultFeature.Symbol = TryCast(LayoutRoot.Resources("StrobeMarkerSymbol"), ESRI.ArcGIS.Client.Symbols.Symbol)
graphicsLayer.Graphics.Add(resultFeature)
Next
Else
MessageBox.Show("No features found")
End If
End Sub
THIS IS MY MARKER SYMBOL FOR select and unselect, as well as my MouseOver (WHICH IS WORKING)
<esri:MarkerSymbol x:Key="StrobeMarkerSymbol">
<esri:MarkerSymbol.ControlTemplate>
<ControlTemplate>
<Canvas>
<VisualStateManager.VisualStateGroups>
<VisualStateGroup x:Name="CommonStates">
<VisualState x:Name="MouseOver">
<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>
<VisualState x:Name="Normal" />
</VisualStateGroup>
<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>
<VisualState x:Name="Unselected" />
</VisualStateGroup>
</VisualStateManager.VisualStateGroups>
<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>