I'm trying to implement something similar to a featuredatagrid where a datagrid and a map are populated by the same observable collection using MVVM.I've got them both synced up quite nicely, except that selecting a graphic on the map does not change the underlying datapoint's IsSelected property. I assume that the IsSelectedBinding property is supposed to implement this functionality.1) Is my assumption right? The sample does not indicate that it is ( http://help.arcgis.com/en/webapi/silverlight/samples/start.htm#UsingPointDataSource ), but in the sample, it appears that the IsSelectedBinding property does nothing at all, which leads me to believe its a bug of some sort. What impact does IsSelectedBinding have on the sample?2) If my assumption is right about what the purpose of IsSelectedBinding is, how might I go about converting the following code behind into MVVM?
private void GraphicsLayer_MouseLeftButtonDown(object sender, ESRI.ArcGIS.Client.GraphicMouseButtonEventArgs e)
{
e.Graphic.Selected = !e.Graphic.Selected;
DataPoint obs = ((MapPageViewModel)datagrid.DataContext).Data.Single(datapoint => datapoint == e.Graphic.Attributes["DataContext"]);
obs.IsSelected = !obs.IsSelected;
}
My XAML is virtually identical to the XAML in the sample, except that there is a datagrid. Here is the PointDataSource elem: <esri:PointDataSource
ItemsSource="{Binding Source={StaticResource ViewModel}, Path=Data, Mode=TwoWay}"
XCoordinateBinding="{Binding X}"
YCoordinateBinding="{Binding Y}"
IsSelectedBinding="{Binding IsSelected, Mode=TwoWay}">
</esri:PointDataSource>My DataPoint class is identical to the example.Hopefully someone knows a thing or two about this feature. There doesn't seem to be many examples of it online (only one post on these forums).Thanks.