The Rectangle
element has StrokeDashArray
which allows it to be drawn with dashes, but it doesn't support rounded corners. The Border
control supports nice thick lines with rounded corners, but will only draw solid lines.
What's the best way to achieve a dashed border with rounded corners, with any control?
Example of dashed border http://img524.imageshack.us/img524/3186/dashedborder.png
WPF Border control does not support dashed lines. If you want to apply a dotted/dashed border for a control, you can simply decorate the control with an adorner.
Here is the sample adorner class. This is a generic adorner for any UIelement.
I have a simple textblock in my xaml and it is contained in a grid named 'LayoutGrid'.
Now, the border can be applied in the code behind
You are mistaken that
Rectangle
does not support this: