Binding RadMap Center not working

2 posts, 0 answers
  1. Jeff
    Jeff avatar
    64 posts
    Member since:
    Dec 2011

    Posted 14 Nov 2012 Link to this post

    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?
  2. Jeff
    Jeff avatar
    64 posts
    Member since:
    Dec 2011

    Posted 14 Nov 2012 Link to this post

    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.
  3. UI for WPF is Visual Studio 2017 Ready
Back to Top