Hi,
I’m using a custom DragSelectingTool to preview some shapes to be drawn when user releases mouse button. It works perfectly with rectangle and ellipse. I use Box.ContentTemplate property inside inherited CreateBox method.
I’m currently trying to preview lines, and I’m facing a problem:
I use Line1 figure, so that line is drawn from the upper left corner of the bow to the lower right one. It is ok when I drag mouse to the lower right or the upper left of the initial point. In the other cases, my line is not drawn as desired (because my start and end points are the two other corners).
If I use Line2 figure, it works for the last case but not for the 2 first.
So I try to detect in which case I am (inside DoMouseMove method) and I change Box.ContentTemplate depending on where my current mouse position is, depending on the initial one.
But result is weird, once I change content template, box size becomes (101;101) and never changes.
Do you have an idea on this problem, or an advice on how to make this differently ?
I hope to be clear enough, don’t hesitate if you need more information
Regards