0

I have dashed path defined by PathGeometry like this:

<Path Stretch="Fill"
      StrokeDashArray="20 10"
      Stroke="Black">
      <Path.Data>
        <PathGeometry Figures="M 0,0 M 0.5,0 V 1 M 1,1">
        </PathGeometry>
      </Path.Data>
</Path>

But when I resize the window number of dashes increase due to StrokeDashArray definition. It is possible to set fixed number of dashes during resize? For example 4 dashes or parametric length of dashes and gaps. Something like: length is equal to 1/4 of whole path?

I tried to change ScaleTransform for PathGeometry but it affect whole path and yes I read this question and it is different problem.

Majlik
  • 1,082
  • 1
  • 10
  • 20
  • I may be reading it wrong, but it sounds like you're just looking to set StrokeDashOffset. – Chris W. May 06 '15 at 14:27
  • From my understanding of `StrokeDashOffset` it will just adjust starting position of first dash but I need to fix number of dashes during resize. I will update question to be more clear. – Majlik May 06 '15 at 14:48
  • So you want it to remain the same amount of dashes, but let them grow in size with resize? Yea sorry, must not be visualizing what you're asking correctly. – Chris W. May 06 '15 at 15:10
  • Yea that is my goal. – Majlik May 06 '15 at 15:39
  • 1
    If that's the case, as far as I know you're going to have to have to fake it. Be it by say putting a bunch of thin width Rectangles in a StackPanel or something, or a bunch of individual lines in a compound path etc. – Chris W. May 06 '15 at 18:17

0 Answers0