This project has moved and is read-only. For the latest updates, please go here.

Binding to MapPolyline Stroke

Mar 1, 2013 at 12:24 PM
Edited Mar 1, 2013 at 12:24 PM
Hi Clemens

Having some trouble binding a property to the 'Stroke' property of the MapPolyLine.

I have my Polyline:
<map:MapPolyline Name="polyz" Canvas.ZIndex="0" Locations ="{Binding Locations}" Stroke="{Binding Backgroundb}" StrokeThickness="5"/>
And in my ViewModel:
        private Brush _backgroundb;
        public Brush Backgroundb
                return _backgroundb;

                _backgroundb = value;

        public MapViewModel()
            Backgroundb = new SolidColorBrush(Colors.Yellow);
But the polyline isn't drawn on the map, and if I try and interact with the collection I get the error:
Cannot resolve all property references in the property path 'Stroke.Color'. Verify that applicable objects support the properties.
Any ideas?
Mar 1, 2013 at 1:44 PM
Mar 1, 2013 at 2:06 PM
Don't know what I can do here. MapPolyline is a standard WPF Shape (or a Path in Silverlight/WinRT). There is no code in MapPolyline that deals with its Stroke property.
Mar 1, 2013 at 3:41 PM
Thanks Clemens

Another quick question - is it possible to disable clicking a Pushpin? I've set it to IsEnabled="False", but I'm still selecting them when clicking around my map and their opacity is 0.

Thanks again
Mar 1, 2013 at 5:18 PM
You may set IsHitTestVisible="False".

Please also note that I made a new release today, which may solve issues with initially invisible MapPolylines in the WPF version.