I'm trying to create a Shape this way:
Shape shape = new Path {
StrokeThickness = 3,
Stroke = Brushes.Coral, Fill = Brushes.Purple,
Data = new PathGeometry {
Figures = new PathFigureCollection {
new PathFigure {
Segments = "M 15,0 H 20 V 15 H 35 V 20 H 20 V 35 H 15 V 20 H 0 V 15 H 15 Z"
}
}
}
};
I've tried similar several combinations to get the path mini-language converted into a Segment collection to no avail. Can someone help?
I know how to do it in XAML, but I need the C# equivalent:
<Path StrokeThickness="3"
Stroke="Coral" Fill="Purple"
Data="M 15,0 H 20 V 15 H 35 V 20 H 20 V 35 H 15
V 20 H 0 V 15 H 15 Z" />