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
I need to draw a dashed rectangle on selection of items in an itemcontrol.I
Share
When you call
DrawingContext.DrawRectangleyou should specify thePen penparameter which is used to draw stroke. So you can create thePeninstance and set thePen.DashStyleproperty.