2

How can I avoid line dash resize during the window resize? Consider the following image: http://leprastuff.ru/data/img/20130315/b83eea4a7a3f07ca53a0e118ddbb9230.Gif

<Rectangle SnapsToDevicePixels="True"
           Stroke="DarkGray"
           StrokeDashArray="10 10"
           StrokeThickness="1" />

Thanks, Tony.

Tony
  • 1,422
  • 1
  • 11
  • 12

1 Answers1

3

Set the Height of the Rectangle to something greater than one.

Currently you're drawing the upper and lower border on top of each other. As the dashed stroke draws the Rectangle's border clockwise, starting at the top-left corner, you get the observed behaviour.

If you intended to draw a Rectangle with a height of one, you might better draw a Line instead.

Clemens
  • 123,504
  • 12
  • 155
  • 268
  • Wow, that was pretty obvious, thanks. Might have figured out it myself. Line was a little more verbose to specify it as a dashed separator, so I decided to use a Rectangle, but it seems that you cannot leave only one side of the rectangle visible. Switched to a line, works like a charm. – Tony Mar 19 '13 at 08:47