public class CADSymbol : ESRI.ArcGIS.Client.Symbols.MarkerSymbol { public static readonly DependencyProperty ColorProperty = DependencyProperty.Register("Color", typeof(Brush), typeof(CADSymbol), null); public CADSymbol(Brush brush) { this.Color = brush; ResourceDictionary resDictionary = new ResourceDictionary(); resDictionary.Source = new Uri("/SMART;component/Symbols/EsriSymbols.xaml", UriKind.Relative); ControlTemplate = resDictionary["CADFeedSymbolBase"] as ControlTemplate; // set offsets such that symbol is centered on point double symbolWidth = Convert.ToDouble(resDictionary["CadSymbolWidth"]); double symbolHeight = Convert.ToDouble(resDictionary["CadSymbolHeight"]); this.OffsetX = symbolWidth / 2.0; this.OffsetY = symbolHeight / 2.0; } public Brush Color { get { return (Brush)GetValue(ColorProperty); } set { SetValue(ColorProperty, value); } } public ESRI.ArcGIS.Client.Symbols.Symbol GetSymbol(ESRI.ArcGIS.Client.Graphic graphic) { return this; } } <system:Double x:Key="CadSymbolWidth">32</system:Double> <system:Double x:Key="CadSymbolHeight">28</system:Double> <ControlTemplate x:Key="CADFeedSymbolBase" > <Grid RenderTransformOrigin="0.5,0.5"> <Grid.RenderTransform> <TransformGroup> <ScaleTransform ScaleX="1" ScaleY="1" /> </TransformGroup> </Grid.RenderTransform> <VisualStateManager.VisualStateGroups> <VisualStateGroup x:Name="CommonStates"> <VisualState x:Name="Normal" /> <VisualState x:Name="MouseOver"> <Storyboard> <DoubleAnimation Storyboard.TargetName="MouseoverElement" Storyboard.TargetProperty="Opacity" From="0.0" To="1.0" Duration="0:0:0.1" /> </Storyboard> </VisualState> </VisualStateGroup> </VisualStateManager.VisualStateGroups> <Canvas HorizontalAlignment="Left" VerticalAlignment="Top"> <Path x:Name="MouseoverElement" Width="30" Height="26" Data="F1 M 1.12181e-007,10.2667L 5.84208,0L 11.48,10.2667L 1.12181e-007,10.2667 Z " Canvas.Left="1.831" Canvas.Top="1.594" UseLayoutRounding="False" Stretch="Fill" Fill="#FFE41B1B" StrokeThickness="0" Opacity="0" > <Path.Effect> <DropShadowEffect BlurRadius="42" ShadowDepth="0" Color="#FFFF0000" Opacity="0.85"/> </Path.Effect> </Path> <Path x:Name="BackgroundColor" Width="30" Height="26" Data="F1 M 1.12181e-007,10.2667L 5.84208,0L 11.48,10.2667L 1.12181e-007,10.2667 Z " Canvas.Left="1.831" Canvas.Top="1.594" UseLayoutRounding="False" Stretch="Fill" Fill="{Binding Symbol.Color}" StrokeThickness="0" > <Path.Effect> <DropShadowEffect BlurRadius="8" ShadowDepth="3" Color="#FF393939" Opacity="0.85"/> </Path.Effect> </Path> <Path Width="{StaticResource CadSymbolWidth}" Height="{StaticResource CadSymbolHeight}" Data="F1 M 1.12181e-007,10.2667L 5.84208,0L 11.48,10.2667L 1.12181e-007,10.2667 Z " Canvas.Left="0.818" Canvas.Top="0.607" UseLayoutRounding="False" Stretch="Fill" StrokeThickness="2" StrokeLineJoin="Round" > <Path.Fill> <RadialGradientBrush RadiusX="0.564909" RadiusY="0.564909" Center="0.422,0.513" GradientOrigin="0.422,0.513"> <RadialGradientBrush.GradientStops> <GradientStop Color="#A4FFFFFF" Offset="0"/> <GradientStop Color="#52FFFFFF" Offset="0.40678"/> <GradientStop Color="#00FFFBFB" Offset="1"/> </RadialGradientBrush.GradientStops> <RadialGradientBrush.RelativeTransform> <TransformGroup/> </RadialGradientBrush.RelativeTransform> </RadialGradientBrush> </Path.Fill> <Path.Stroke> <LinearGradientBrush EndPoint="0.967,1.005" StartPoint="0.203,0.105"> <GradientStop Color="#FFE2E2E2"/> <GradientStop Color="#FFB6B5B5" Offset="1"/> </LinearGradientBrush> </Path.Stroke> <Path.Effect> <DropShadowEffect x:Name="MouseOverEffect" BlurRadius="15" Color="Red" Opacity="0" ShadowDepth="2" Direction="-60" /> </Path.Effect> </Path> <TextBlock Margin="13,10,0,0" TextWrapping="NoWrap" Text="{Binding Attributes[Priority]}" FontWeight="Bold" FontFamily="Arial Unicode MS" FontSize="12" /> </Canvas> </Grid> </ControlTemplate>UniqueValueRenderer renderer = new UniqueValueRenderer(); renderer.Field = "Priority"; renderer.Infos.Add(new UniqueValueInfo { Symbol = new CADSymbol(new SolidColorBrush(Colors.Red)), Value = "1", Label = "Priority 1", Description = "Priority 1 CAD Call" }); renderer.Infos.Add(new UniqueValueInfo { Symbol = new CADSymbol(new SolidColorBrush(Colors.Orange)), Value = "2", Label = "Priority 2", Description = "Priority 2 CAD Call" }); renderer.Infos.Add(new UniqueValueInfo { Symbol = new CADSymbol(new SolidColorBrush(Colors.Yellow)), Value = "3", Label = "Priority 3", Description = "Priority 3 CAD Call" }); renderer.Infos.Add(new UniqueValueInfo { Symbol = new CADSymbol(new SolidColorBrush(Colors.Green)), Value = "4", Label = "Priority 4", Description = "Priority 4 CAD Call" }); // assign rendered to graphics layer graphicsLayerCadFeed.Renderer = renderer;<esri:Legend.LegendItemTemplate> <DataTemplate> <StackPanel Orientation="Horizontal" > <!--Height="40"--> <!--Stretch="None"--> <Image Height="40" Source="{Binding ImageSource}"></Image> <ContentControl Content="{Binding Label}" VerticalAlignment="Center" Margin="6,0,0,0" /> </StackPanel> </DataTemplate> </esri:Legend.LegendItemTemplate>Solved! Go to Solution.
<Grid RenderTransformOrigin="0.5,0.5" Width="{StaticResource CadSymbolWidth}" Height="{StaticResource CadSymbolHeight}" ><Grid RenderTransformOrigin="0.5,0.5" Width="{StaticResource CadSymbolWidth}" Height="{StaticResource CadSymbolHeight}" >