Question

what I'm trying to achieve is having a dotted line being drawn from one edge of its parent to the other. Something similar to this:

<Grid x:Name="LayoutRoot" >
    <Line Margin="0,0,0,0" Stroke="Black" X2="{Binding ElementName=LayoutRoot, Path=ActualWidth}" StrokeDashArray="1,1" Stretch="UniformToFill"/>
</Grid>

The thing is, the above only seems to work at design-time.

Problem #2 is that even if I succeed to draw something similar to this, it gets ruined by antialiasing. I know SL does not have the SnapsToDevicePixels option, but neither UseLayoutRounding, nor the PixelSnapper could prevent my 1px dotted line from being spread across 2 pixel lines in certain scenarios.

No correct solution

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top