Solved! Go to Solution.
<ControlTemplate xmlns="http://schemas.microsoft.com/client/2007" xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" xmlns:vsm="clr-namespace:System.Windows;assembly=System.Windows" xmlns:converter="clr-namespace:ESRI.ArcGIS.Client.ValueConverters;assembly=ESRI.ArcGIS.Client" xmlns:sys="clr-namespace:System;assembly=mscorlib" xmlns:esri="clr-namespace:ESRI.ArcGIS.Client;assembly=ESRI.ArcGIS.Client"> <Canvas x:Name="Root" Cursor="Hand" esri:Clusterer.ClusterChildElements="{FlareIDs}"> <Canvas.Resources> <!--define converter for dictionaries so we can bind to to the attributes on the graphic--> <converter:DictionaryConverter x:Name="DictConvert" /> <sys:Double x:Name="expandSize">35</sys:Double> <sys:Double x:Name="strokeThickness">2</sys:Double> <SolidColorBrush Color="#3B64AA" x:Name="FillColor" /> <SolidColorBrush Color="White" x:Name="StrokeColor" /> </Canvas.Resources> <vsm:VisualStateManager.VisualStateGroups> <vsm:VisualStateGroup x:Name="CommonStates"> <!--When mouse hovers on graphic, expand the graphic to show the image and title--> <vsm:VisualState x:Name="MouseOver"> <Storyboard> <DoubleAnimation BeginTime="0:0:0" Storyboard.TargetName="rotation" Storyboard.TargetProperty="Angle" To="360" Duration="0:0:0.5" /> <DoubleAnimation BeginTime="0:0:0" Storyboard.TargetName="Flares" Storyboard.TargetProperty="Opacity" To="1" Duration="0:0:0.5" /> <DoubleAnimation BeginTime="0:0:0" Storyboard.TargetName="Flares" Storyboard.TargetProperty="Width" To="{StaticResource expandSize}" Duration="0:0:0.5" /> <DoubleAnimation BeginTime="0:0:0" Storyboard.TargetName="mainSymbol" Storyboard.TargetProperty="StrokeThickness" To="3" Duration="0:0:0.5" RepeatBehavior="Forever" AutoReverse="True" /> </Storyboard> </vsm:VisualState> <!--When mouse leaves graphic, restore the marker size and hide the text--> <vsm:VisualState x:Name="Normal"> <Storyboard> <Storyboard> <DoubleAnimation BeginTime="0:0:0.5" Storyboard.TargetName="rotation" Storyboard.TargetProperty="Angle" To="0" Duration="0:0:0.5" /> <DoubleAnimation BeginTime="0:0:0.5" Storyboard.TargetName="Flares" Storyboard.TargetProperty="Opacity" To="0" Duration="0:0:0.5" /> <DoubleAnimation BeginTime="0:0:0.5" Storyboard.TargetName="Flares" Storyboard.TargetProperty="Width" To="0" Duration="0:0:0.5" /> </Storyboard> </Storyboard> </vsm:VisualState> </vsm:VisualStateGroup> </vsm:VisualStateManager.VisualStateGroups> <Canvas Canvas.Left="0" Canvas.Top="-8" > <Grid Width="0" x:Name="Flares" RenderTransformOrigin="0,0.5"> <Grid.RenderTransform> <RotateTransform x:Name="rotation" Angle="0" /> </Grid.RenderTransform> {Binding FlareOuts} </Grid> <Grid Width="20" Height="20" Canvas.Left="-10" Canvas.Top="-2"> <Ellipse Fill="{Binding Symbol.FillColor}" x:Name="mainSymbol" StrokeThickness="{StaticResource strokeThickness}" Stroke="{Binding Symbol.ForeColor}" /> <TextBlock HorizontalAlignment="Center" VerticalAlignment="Center" Text="{Binding Path=Attributes, Converter={StaticResource DictConvert}, ConverterParameter=Count, Mode=OneWay}" FontSize="9" Margin="0" FontWeight="Bold" Foreground="{Binding Symbol.ForeColor}" /> </Grid> </Canvas> </Canvas> </ControlTemplate>
<ControlTemplate xmlns="http://schemas.microsoft.com/client/2007" xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" xmlns:vsm="clr-namespace:System.Windows;assembly=System.Windows" xmlns:converter="clr-namespace:ESRI.ArcGIS.Client.ValueConverters;assembly=ESRI.ArcGIS.Client" xmlns:sys="clr-namespace:System;assembly=mscorlib" xmlns:esri="clr-namespace:ESRI.ArcGIS.Client;assembly=ESRI.ArcGIS.Client"> <Canvas x:Name="Root" Cursor="Hand" esri:Clusterer.ClusterChildElements="{FlareIDs}"> <Canvas.Resources> <!--define converter for dictionaries so we can bind to to the attributes on the graphic--> <converter:DictionaryConverter x:Name="DictConvert" /> <sys:Double x:Name="expandSize">35</sys:Double> <sys:Double x:Name="strokeThickness">2</sys:Double> <SolidColorBrush Color="#3B64AA" x:Name="FillColor" /> <SolidColorBrush Color="White" x:Name="StrokeColor" /> </Canvas.Resources> <vsm:VisualStateManager.VisualStateGroups> <vsm:VisualStateGroup x:Name="CommonStates"> <!--When mouse hovers on graphic, expand the graphic to show the image and title--> <vsm:VisualState x:Name="MouseOver"> <Storyboard> <DoubleAnimation BeginTime="0:0:0" Storyboard.TargetName="rotation" Storyboard.TargetProperty="Angle" To="360" Duration="0:0:0.5" /> <DoubleAnimation BeginTime="0:0:0" Storyboard.TargetName="Flares" Storyboard.TargetProperty="Opacity" To="1" Duration="0:0:0.5" /> <DoubleAnimation BeginTime="0:0:0" Storyboard.TargetName="Flares" Storyboard.TargetProperty="Width" To="{StaticResource expandSize}" Duration="0:0:0.5" /> <DoubleAnimation BeginTime="0:0:0" Storyboard.TargetName="mainSymbol" Storyboard.TargetProperty="StrokeThickness" To="3" Duration="0:0:0.5" RepeatBehavior="Forever" AutoReverse="True" /> </Storyboard> </vsm:VisualState> <!--When mouse leaves graphic, restore the marker size and hide the text--> <vsm:VisualState x:Name="Normal"> <Storyboard> <Storyboard> <DoubleAnimation BeginTime="0:0:0.5" Storyboard.TargetName="rotation" Storyboard.TargetProperty="Angle" To="0" Duration="0:0:0.5" /> <DoubleAnimation BeginTime="0:0:0.5" Storyboard.TargetName="Flares" Storyboard.TargetProperty="Opacity" To="0" Duration="0:0:0.5" /> <DoubleAnimation BeginTime="0:0:0.5" Storyboard.TargetName="Flares" Storyboard.TargetProperty="Width" To="0" Duration="0:0:0.5" /> </Storyboard> </Storyboard> </vsm:VisualState> </vsm:VisualStateGroup> </vsm:VisualStateManager.VisualStateGroups> <Canvas Canvas.Left="0" Canvas.Top="-8" > <Grid Width="0" x:Name="Flares" RenderTransformOrigin="0,0.5"> <Grid.RenderTransform> <RotateTransform x:Name="rotation" Angle="0" /> </Grid.RenderTransform> {Binding FlareOuts} </Grid> <Grid Width="20" Height="20" Canvas.Left="-10" Canvas.Top="-2"> <Ellipse Fill="{Binding Symbol.FillColor}" x:Name="mainSymbol" StrokeThickness="{StaticResource strokeThickness}" Stroke="{Binding Symbol.ForeColor}" /> <TextBlock HorizontalAlignment="Center" VerticalAlignment="Center" Text="{Binding Path=Attributes, Converter={StaticResource DictConvert}, ConverterParameter=Count, Mode=OneWay}" FontSize="9" Margin="0" FontWeight="Bold" Foreground="{Binding Symbol.ForeColor}" /> </Grid> </Canvas> </Canvas> </ControlTemplate>