Your Privacy Matters: We use our own and third-party cookies to improve your experience on our website. By continuing to use the website we understand that you accept their use. Cookie Policy
1531
Set GeographicPolylineSeries color programmatically
posted

Hello,

I have several GeographicPolylineSeries objects which I want to plot on a XamGeographic map, but I need to be able to set the color of each series programmatically.

I was hoping to do something like this:

     Style style = new Style();

     style.Setters.Add(new Setter(GeographicPolylineSeries.BrushProperty, Brushes.Red));

     ...

     GeographicPolylineSeries polySeries = new GeographicPolylineSeries();

     polySeries.ShapeStyle = style;

     ...

     DataMap.Series.Add(polySeries);

This obviously does not work.  Through XAML, I've been able to "hard-code" a series color using the "Stroke" property, but I don't see where that property is exposed anywhere as a dependency property to supply to the style's setters object.  Is there something I'm missing or some other preferred method for doing this?

Thanks, Steve