Current Position Databinding

Topics: Feature Requests, WPF
Mar 9, 2013 at 10:15 PM
Hi Radioman,

is it possible to change the current position so that it can handle databinding. Ive tried to put in a dependency property in the custom map file but it break the map :)
 public PointLatLng CurrentPosition
        {
            get
            {
                return (PointLatLng)GetValue(CurrentPositionProperty);
            }
            set
            {
                SetValue(CurrentPositionProperty, value);
            }
        }

        public static readonly DependencyProperty CurrentPositionProperty =
            DependencyProperty.Register("CurrentPosition", typeof(PointLatLng), typeof(Map), new UIPropertyMetadata(null, CurrentPositionChangedCallBack));

        static void CurrentPositionChangedCallBack(DependencyObject d, DependencyPropertyChangedEventArgs e)
        {
            Map cp = (Map)d;
            cp.CurrentPosition = (PointLatLng)e.NewValue;
        }
Coordinator
Mar 10, 2013 at 6:09 AM
'break' ?
Mar 10, 2013 at 10:27 AM
The error I get is "Cannot create an instance of 'Map'"
'The invocation of the constructor on type 'WpfGmap2012.MapControls.Map' that matches the specified binding constraints threw an exception.' Line number '66' and line position '38'.