//Create a polygon graphic with simple line and fill styles.
//Construct on the worker thread
await QueuedTask.Run(() =>
{
//Build geometry
List<Coordinate2D> plyCoords = new List<Coordinate2D>();
plyCoords.Add(new Coordinate2D(1, 7));
plyCoords.Add(new Coordinate2D(2, 7));
plyCoords.Add(new Coordinate2D(2, 6.7));
plyCoords.Add(new Coordinate2D(3, 6.7));
plyCoords.Add(new Coordinate2D(3, 6.1));
plyCoords.Add(new Coordinate2D(1, 6.1));
Polygon poly = PolygonBuilder.CreatePolygon(plyCoords);
//Set symbolology, create and add element to layout
CIMStroke outline = SymbolFactory.Instance.ConstructStroke(ColorFactory.Instance.BlueRGB, 2.0, SimpleLineStyle.DashDotDot);
CIMPolygonSymbol polySym = SymbolFactory.Instance.ConstructPolygonSymbol(ColorFactory.Instance.RedRGB, SimpleFillStyle.ForwardDiagonal, outline);
GraphicElement polyElm = LayoutElementFactory.Instance.CreatePolygonGraphicElement(layout, poly, polySym);
polyElm.SetName("New Polygon");
});