Hello,
I'm using the XamGeographicMap control and plotting a GeographicSymbolSeries. I want to use a data trigger to customize the marker based on one of the properties of the series ItemsSource.
I'm trying something like this in my XAML:
<LinearGradientBrush x:Key="StandardBackground" EndPoint="0.5,1" StartPoint="0.5,0">
<GradientStop Color="#FF8CCDEC" />
<GradientStop Color="#FF38A3D6" Offset="1" />
</LinearGradientBrush>
<LinearGradientBrush x:Key="PoolBackground" EndPoint="0.5,1" StartPoint="0.5,0">
<GradientStop Color="#FFEAEC8C" />
<GradientStop Color="#FFD4D638" Offset="1" />
<SolidColorBrush x:Key="StandardStroke" Color="Black" />
<Ellipse x:Key="StandardEllipse"
Width="10"
Height="10"
Fill="{StaticResource StandardBackground}"
Stroke="{StaticResource StandardStroke}"
StrokeThickness="0.5" />
<Ellipse x:Key="PoolEllipse"
Fill="{StaticResource PoolBackground}"
<DataTemplate x:Key="MarkerTemplate">
<ContentControl Content="{Binding}"/>
<DataTemplate.Triggers>
<DataTrigger Binding="{Binding RelativeSource={RelativeSource Self}, Path=MeterType}" Value="Standard">
<Setter Property="Content" Value="{StaticResource StandardEllipse}" />
</DataTrigger>
<DataTrigger Binding="{Binding RelativeSource={RelativeSource Self}, Path=MeterType}" Value="Pool">
<Setter Property="Content" Value="{StaticResource PoolEllipse}" />
</DataTemplate.Triggers>
</DataTemplate>
Then when I create the series, I set it's MarkerTemplate to "MarkerTemplate". This obviously doesn't work. Are there any examples of using DataTriggers for controlling the MarkerTemplate of a GeographicSymbolSeries?
Thanks, Steve
Thanks Diyan. I worked on it some more after I submitted the post and got pretty close, but not quite right. You're sample worked perfectly!
Thanks again,
Steve
Hi Steve,
I am attaching a sample project with the functionality you want. If you need any further assistance on the matter do not hesitate to ask.
Thanks,
Diyan Dimitrov