Silverlight 1px dotted line with no antialiasing
-
19-10-2022 - |
Domanda
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.
Nessuna soluzione corretta
Autorizzato sotto: CC-BY-SA insieme a attribuzione
Non affiliato a StackOverflow