It seems esriToolkitPrimitives does not show a custom Marker Symbol collection . When I use a custom Marker Symbol ( inherited form MakerSymbol with size and color dependency properties ) , the symbols do not show up in the combo box. I do not have any problem if i switch to MarkerSymbol collection intead of custom ones.
<StackPanel Orientation="Horizontal">
<ComboBox x:Name="ComboMarkerSymbol" ItemsSource="{StaticResource EsriCustomMarkerSymbolCollection}" HorizontalAlignment="Left" VerticalAlignment="Top" >
<ComboBox.ItemsPanel>
<ItemsPanelTemplate>
<toolkit:WrapPanel Orientation="Horizontal" Background="LightBlue" Width="210" VerticalAlignment="Top"/>
</ItemsPanelTemplate>
</ComboBox.ItemsPanel>
<ComboBox.ItemTemplate>
<DataTemplate>
<Button Click="MarkerSymbolButton_Click" >
<esriToolkitPrimitives:SymbolDisplay Height="25" Width="30" Symbol="{Binding}" />
</Button>
</DataTemplate>
</ComboBox.ItemTemplate>
</ComboBox>
</StackPanel>
here is the custom Market Symbol:
---------------------------------------------------------------------------------------------
public class CustomMarkerSymbol : MarkerSymbol
{
public static readonly DependencyProperty ColorProperty = DependencyProperty.Register("Color", typeof(Brush), typeof(CustomMarkerSymbol), null);
public static readonly DependencyProperty SelectionColorProperty = DependencyProperty.Register("SelectionColor", typeof(Brush), typeof(CustomMarkerSymbol), null);
public static readonly DependencyProperty SizeProperty = DependencyProperty.Register("Size", typeof(double), typeof(CustomMarkerSymbol), null);
public CustomMarkerSymbol()
{
this.Color = new SolidColorBrush(Colors.Red);
this.SelectionColor = new SolidColorBrush(Colors.Cyan);
}
public Brush Color
{
get
{
return (Brush)GetValue(ColorProperty);
}
set
{
SetValue(ColorProperty, value);
}
}
...............
and here is my dictionary :
<local:ObjectCollection x:Name="EsriCustomMarkerSymbolCollection">
<classData:CustomMarkerSymbol x:Name="CustomMarker_33" OffsetX="6.5" OffsetY="6.5">
<classData:CustomMarkerSymbol.ControlTemplate>
<ControlTemplate>
<Grid RenderTransformOrigin="0.5,0.5">
<Grid.RenderTransform>
<TransformGroup>
<ScaleTransform ScaleX="{Binding Symbol.Size}" ScaleY="{Binding Symbol.Size}" />
</TransformGroup>
</Grid.RenderTransform>
<Ellipse Width="13" Height="13" Fill="{Binding Symbol.Color}" HorizontalAlignment="Center" VerticalAlignment="Center" />
</Grid>
</ControlTemplate>
</classData:CustomMarkerSymbol.ControlTemplate>
</classData:CustomMarkerSymbol>
</local:ObjectCollection>
</ResourceDictionary>