<esri:SimpleRenderer x:Key="SelectFillSymbol"> <esri:SimpleRenderer.Symbol> <esri:FillSymbol> <esri:FillSymbol.ControlTemplate> <ControlTemplate> <Path x:Name="Element" Stroke="Black" StrokeStartLineCap="Round" StrokeThickness="1.5" StrokeLineJoin="Round" StrokeEndLineCap="Round" Fill="#00FFFFFF"> <VisualStateManager.VisualStateGroups> <VisualStateGroup x:Name="SelectionStates"> <VisualState x:Name="Unselected" > <Storyboard> <ColorAnimation Storyboard.TargetName="Element" Storyboard.TargetProperty="(Path.Fill).(SolidColorBrush.Color)" To="#00FFFFFF" Duration="00:00:00.25"/> </Storyboard> </VisualState> <VisualState x:Name="Selected"> <Storyboard> <ColorAnimation Storyboard.TargetName="Element" Storyboard.TargetProperty="(Path.Fill).(SolidColorBrush.Color)" To="#44AA00FF" Duration="00:00:00.25"/> <ObjectAnimationUsingKeyFrames Storyboard.TargetName="Element" Storyboard.TargetProperty="StrokeDashArray"> <DiscreteObjectKeyFrame KeyTime="0:0:0"> <DiscreteObjectKeyFrame.Value> <DoubleCollection>2,1</DoubleCollection> </DiscreteObjectKeyFrame.Value> </DiscreteObjectKeyFrame> </ObjectAnimationUsingKeyFrames> </Storyboard> </VisualState> </VisualStateGroup> <VisualStateGroup x:Name="CommonStates"> <VisualState x:Name="Normal" /> </VisualStateGroup> </VisualStateManager.VisualStateGroups> </Path> </ControlTemplate> </esri:FillSymbol.ControlTemplate> </esri:FillSymbol> </esri:SimpleRenderer.Symbol> </esri:SimpleRenderer>
MyGraphicsLayer.Graphics.Where<Graphic>(sector => MySelectedList.Contains(int.Parse(sector.Attributes["SectorID"].ToString()))) .ToList<Graphic>().ForEach(g => { if (!g.Selected) g.Select(); });