<esri:SimpleLineSymbol x:Key="ResultsLineSymbol"> <esri:SimpleLineSymbol.ControlTemplate> <ControlTemplate x:Name="CustomLineTemplate"> <Grid> <VisualStateManager.VisualStateGroups> <VisualStateGroup x:Name="CommonStates"> <VisualState x:Name="Normal"> </VisualState> <VisualState x:Name="MouseOver"> <Storyboard> <ColorAnimation BeginTime="0:0:0" Storyboard.TargetName="SymbolGeom" Storyboard.TargetProperty="(Line.Fill).(SolidColorBrush.Color)" To="Yellow" Duration="0:0:0"> </ColorAnimation> </Storyboard> </VisualState> <VisualState x:Name="Selected"> <Storyboard> <ColorAnimation BeginTime="0:0:0" Storyboard.TargetName="SymbolGeom" Storyboard.TargetProperty="(Line.Fill).(SolidColorBrush.Color)" To="Yellow" Duration="Forever"> </ColorAnimation> </Storyboard> </VisualState> </VisualStateGroup> </VisualStateManager.VisualStateGroups> <Line x:Name="SymbolGeom" Stroke="Blue" StrokeThickness="3"> <Line.Fill> <SolidColorBrush x:Name="theColor" Color="Aqua"></SolidColorBrush> </Line.Fill> </Line> </Grid> </ControlTemplate> </esri:SimpleLineSymbol.ControlTemplate> </esri:SimpleLineSymbol>
<esri:SimpleLineSymbol x:Key="ResultsLineSymbol" Color="Red" Width="3"> <esri:SimpleLineSymbol.ControlTemplate> <ControlTemplate x:Name="CustomLineTemplate"> <Grid> <VisualStateManager.VisualStateGroups> <VisualStateGroup x:Name="CommonStates"> <VisualState x:Name="Normal"> </VisualState> <VisualState x:Name="MouseOver"> <Storyboard> <ColorAnimation BeginTime="0:0:0" Storyboard.TargetName="SymbolGeom" Storyboard.TargetProperty="(Line.Fill).(SolidColorBrush.Color)" To="Yellow" Duration="0:0:0"> </ColorAnimation> </Storyboard> </VisualState> </VisualStateGroup> <VisualStateGroup x:Name="SelectionStates"> <VisualState x:Name="Selected"> <Storyboard> <ColorAnimation BeginTime="0:0:0" Storyboard.TargetName="SymbolGeom" Storyboard.TargetProperty="(Line.Fill).(SolidColorBrush.Color)" To="Yellow" Duration="Forever"> </ColorAnimation> </Storyboard> </VisualState> </VisualStateGroup> </VisualStateManager.VisualStateGroups> <Line x:Name="SymbolGeom" Width="3"> <Line.Fill> <SolidColorBrush x:Name="theColor" Color="Aqua"></SolidColorBrush> </Line.Fill> </Line> </Grid> </ControlTemplate> </esri:SimpleLineSymbol.ControlTemplate> </esri:SimpleLineSymbol>
feature.Symbol = LayoutRoot.Resources["ResultsLineSymbol"] as LineSymbol;
<esri:SimpleLineSymbol x:Key="ResultsLineSymbol">
<esri:SimpleLineSymbol.ControlTemplate>
<ControlTemplate x:Name="ResultsLineSymbolTemplate">
<Grid>
<VisualStateManager.VisualStateGroups>
<VisualStateGroup x:Name="CommonStates">
<VisualState x:Name="Normal">
<Storyboard>
<ColorAnimation Storyboard.TargetName="Element"
Storyboard.TargetProperty="(Stroke).(Color)"
To="Aqua" Duration="0:0:0.1" />
</Storyboard>
</VisualState>
<VisualState x:Name="MouseOver">
<Storyboard>
<ColorAnimation Storyboard.TargetName="Element"
Storyboard.TargetProperty="(Stroke).(Color)"
To="Chartreuse" Duration="0:0:0.1" />
</Storyboard>
</VisualState>
<VisualState x:Name="Selected">
<Storyboard>
<ColorAnimation Storyboard.TargetName="Element"
Storyboard.TargetProperty="(Stroke).(Color)"
To="Yellow" Duration="0:0:0.1" />
</Storyboard>
</VisualState>
</VisualStateGroup>
</VisualStateManager.VisualStateGroups>
<Path x:Name="Element" Stroke="Aqua" Fill="{x:Null}"
StrokeStartLineCap="Round" StrokeThickness="4"
StrokeLineJoin="Round" StrokeEndLineCap="Round" />
</Grid>
</ControlTemplate>
</esri:SimpleLineSymbol.ControlTemplate>
</esri:SimpleLineSymbol>