<Sync:SfMap>
<Sync:SfMap.Layers>
<Sync:ImageryLayer Markers="{Binding Models}" >
<Sync:ImageryLayer.MarkerTemplate>
<DataTemplate>
<StackPanel Orientation="Horizontal" Background="Transparent">
<Ellipse Width="10" Height="10" Fill="{Binding Data.MarkerColor}" />
</StackPanel>
</DataTemplate>
</Sync:ImageryLayer.MarkerTemplate>
</Sync:ImageryLayer>
</Sync:SfMap.Layers>
</Sync:SfMap> |
public class ViewModel
{
public ObservableCollection<Model> Models { get; set; }
public ViewModel()
{
this.Models = new ObservableCollection<Model>();
this.Models.Add(new Model() { Label = "USA", Latitude = "38.8833N", Longitude = "77.0167W", MarkerColor=new SolidColorBrush(Colors.Red) });
this.Models.Add(new Model() { Label = "Brazil ", Latitude = "15.7833S", Longitude = "47.8667W", MarkerColor = new SolidColorBrush(Colors.Red) });
this.Models.Add(new Model() { Label = "India ", Latitude = "21.0000N", Longitude = "78.0000E", MarkerColor = new SolidColorBrush(Colors.Blue) });
this.Models.Add(new Model() { Label = "China ", Latitude = "35.0000N", Longitude = "103.0000E", MarkerColor = new SolidColorBrush(Colors.Blue) });
this.Models.Add(new Model() { Label = "Indonesia ", Latitude = "6.1750S", Longitude = "106.8283E", MarkerColor = new SolidColorBrush(Colors.Red) });
}
} |