c# - Anchoring/docking behavior in WPF on Canvas layout -


I'm just arranging several elements on a canvas layout, in fact elements represent the interactive flow-chart Is implemented as a change, I need relative change on some elements.

Specifically, I should anchor or dock some elements on their original elements. I get different solutions, though I do not know that they solve my problem in the most beautiful way.

Here's an example:

  & lt; Line X1 = "80" x 2 = "800" Y1 = "730" Y2 = "730" /> & Lt; Polygon point = "0,30 40,0 40,60" canvas.lift = "48" canvas.pop = "700" />   

Polygon pulls a triangle and I want to dock it to the left side of the line, this means when the line is translated into a new condition or while scaling it, the polygon Should move forward with it.

Is this possible?

Place them in your canvas, in this way you can keep the status of the outer canvas completely And keep the interior accessories together

Like this:

  & lt; Canvas & gt; & Lt; Line X1 = "60" X2 = "820" Y1 = "60" Y2 = "760" & gt; & Lt ;! - Some other row - & gt; & Lt; / Line & gt; & Lt; Canvas canvas.lift = "48" canvas.pop = "700" & gt; & Lt; Polygon point = "0,30 40,0 40,60" /> & Lt; Line X1 = "32" X2 = "752" Y1 = "30" Y2 = "30" /> & Lt; / Canvas & gt; & Lt; / Canvas & gt;    

Comments