This is a migrated thread and some comments may be shown as answers.

Binding RadMap Center not working

1 Answer 149 Views
Map
This is a migrated thread and some comments may be shown as answers.
Jeff
Top achievements
Rank 1
Jeff asked on 14 Nov 2012, 08:38 PM
I have a RadMap, with an InformationLayer, in which I am drawing a MapPolygon and a MapPinPoint.

The MapLayer.Location of the PinPoint is bound to a Location property in the viewmodel, that raises PropertyChanged when modified.

When I change the location, in code, the MapPinPoint is drawn in the new location, so I'm pretty sure that I have the binding and the notification working right.

Now here's the thing - I want the map to center on that same location. So I've bound RadMap.Center to that same property. And that's not working - the center of the map does not change, even though the location of the MapPinPoint does, when both are bound to the same property.

Since the MapPinPoint is working, I have to assume that the property is working right, and that the RadMap is ignoring PropertyChanged events on Center.

So how, then, do I change the center of the map, through bound properties?

1 Answer, 1 is accepted

Sort by
0
Jeff
Top achievements
Rank 1
answered on 14 Nov 2012, 08:49 PM
OK, never mind.

Browsing around the forums, I identified the problem.  If the user can change the center of the map, doing so will break the binding.

The solution is to make the binding for Center two-way.  Which, of course, would result in the PushPin always being moved to the center of the map, since I have them bound to the same property. So I added a separate property for the map center, initialized to the same value, and did a two-way binding to that, and things are working.
Tags
Map
Asked by
Jeff
Top achievements
Rank 1
Answers by
Jeff
Top achievements
Rank 1
Share this question
or