Using two-way binding in xamWebMap

[Infragistics] Devin Rader / Monday, March 2, 2009

This snippet demonstrates how you can use the map controls ValueTemplate to allow end users to modify map element values using two-way binding.

 

<igMap:XamWebMap x:Name="MyMap">
  <igMap:XamWebMap.Layers>
    <igMap:MapLayer FillMode="Chloropleth" IsSensitive="False">
      <igMap:MapLayer.ValueTemplate>
        <DataTemplate>
          <StackPanel Orientation="Horizontal">
            <Slider Width="100" Minimum="70000" Maximum="17000000"
                Value="{Binding Value, Mode=TwoWay}" />
            <TextBlock Text="{Binding Value}" />
          </StackPanel>
        </DataTemplate>
      </igMap:MapLayer.ValueTemplate>
      <igMap:MapLayer.Reader>
        <igMap:ShapeFileReader DataMapping="Value=POP_ADMIN" 
            Uri="http://www.foo.com/argentina"/>
      </igMap:MapLayer.Reader>
      <igMap:MapLayer.ValueScale>
        <igMap:LinearScale IsAutoRange="False" 
            MinimumValue="70000" MaximumValue="17000000" />
      </igMap:MapLayer.ValueScale>
    </igMap:MapLayer>
  </igMap:XamWebMap.Layers>
</igMap:XamWebMap>

 

 

Technorati Tags: ,