I'm trying to edit the appearance of a line in WPF. Specifically, I want two lines as my stroke, like "==========" as opposed to "-------------". I tried creating a visual brush and adding two lines, but the result was strange in that it connected the two lines as one line, instead of separating them in parallel.
Is there an easy way to do this? The line will be rotated and resized. I've gotten ideas about using a rectangle with no fill and colored stroke, but the rectangle's orientation stays fixed as you rotate the line.
(In case this at all matters, I'm trying to change the line stroke for Telerik diagram connections)
Is that because they're on the same Canvas, so when you move it to left by 10 pixels, both lines got moved.
I think I'll add Line.RenderTransfrom and then a TranslateTransform with .X changed to the second line.
AFAIK, Canvas.Left on a child element sets that element's offset within its parent. It's not moving the entire canvas.
And in the remarks it said that this properity does not affect the size of parent Canvas as the Bottom and Right property will be adjusted accordingly.
Therefore it definately moving the entire canvas.
If you're suggesting that children can somehow push their parent canvas if they go past the initial boundary, then that's not the case. A canvas' size stays fixed while children will float freely outside the canvas' boundary, unless you specify clipping.
so I suspect the brush has something to do with how it is working.
@figuerres: Yeah, I think the telerik control I'm applying the brush to masks the brush, so only a line representation of the underlying brush is visible. At a very high stroke thickness and at a perfectly right angle, you can see the two distinct lines. The moment you change the orientation of the telerik connection, the lines looks mixed together (as if the underlying lines didn't move).
Comments have been closed since this content was published more than 30 days ago, but if you'd like to continue the conversation, please create a new thread in our Forums, or Contact Us and let us know.