private static void CreateLine(IEnumerable <MapPoint> points, GraphicsLayer layer, string labelValue) { var path = new Polyline(points); var graphic = new Graphic { Geometry = path }; graphic.Attributes["LENGTH"] = string.Format("{0}'", labelValue); var symbol = new SimpleLineSymbol { Color = Colors.DarkRed, Style = SimpleLineStyle.Solid, Width = 2 }; graphic.Symbol = symbol; graphic.ZIndex = 1000; layer.Invoke(l => l.Graphics.Add(graphic)); }