I updated your code like below:
Polygon poly = new Polygon();
poly.Points = new PointCollection();
poly.Points.Add(new Point(0, 0));
poly.Points.Add(new Point(12, 0));
poly.Points.Add(new Point(17, 7));
poly.Points.Add(new Point(12, 14));
poly.Points.Add(new Point(0, 14));
poly.StrokeLineJoin = PenLineJoin.Round;
poly.StrokeStartLineCap = PenLineCap.Round;
poly.StrokeEndLineCap = PenLineCap.Round;
// Add below code
poly.StrokeThickness = 10;
poly.Stroke = Brushes.Red;
Thickness myThickness = new Thickness();
myThickness.Left = 50;
myThickness.Top = 50;
poly.Margin = myThickness;
The result picture is:
Is this want you want? If I misunderstand your question, please point out.
If the response is helpful, please click "Accept Answer" and upvote it.
Note: Please follow the steps in our documentation to enable e-mail notifications if you want to receive the related email notification for this thread.