//Create a graphic freehand element with a simple line style.
//Construct on the worker thread
await QueuedTask.Run(() =>
{
//Build geometry
List<Coordinate2D> plCoords = new List<Coordinate2D>();
plCoords.Add(new Coordinate2D(1.5, 10.5));
plCoords.Add(new Coordinate2D(1.25, 9.5));
plCoords.Add(new Coordinate2D(1, 10.5));
plCoords.Add(new Coordinate2D(0.75, 9.5));
plCoords.Add(new Coordinate2D(0.5, 10.5));
plCoords.Add(new Coordinate2D(0.5, 1));
plCoords.Add(new Coordinate2D(0.75, 2));
plCoords.Add(new Coordinate2D(1, 1));
Polyline linePl = PolylineBuilder.CreatePolyline(plCoords);
//Set symbolology, create and add element to layout
CIMLineSymbol lineSym = SymbolFactory.Instance.ConstructLineSymbol(ColorFactory.Instance.BlackRGB, 2.0, SimpleLineStyle.Solid);
GraphicElement lineElm = LayoutElementFactory.Instance.CreateLineGraphicElement(layout, linePl, lineSym);
lineElm.SetName("New Freehand");
});