0

I need to draw a dashed rectangle on selection of items in an itemcontrol.I am looking for a way to draw a rectangle by DrawingContext.We have got DrawingContext.DrawRectangle and DawingContext.DrawRoundedRectangle.But How can we give the properties like Stroke and StrokeDashArray of the Rectangle

biju
  • 17,554
  • 10
  • 59
  • 95

1 Answers1

1

When you call DrawingContext.DrawRectangle you should specify the Pen pen parameter which is used to draw stroke. So you can create the Pen instance and set the Pen.DashStyle property.

treetey
  • 829
  • 1
  • 6
  • 16