c# - Bind to element's position relative to a parent in WPF -
To get the position of the sub-sub element relative to the container, I need something that TransformToAncestor does, however, move elements and sublettions Doing, changing the shape of the change, their layout etc. I need a way to keep the status up-to-date Like an incident, due to anything that affects my Transformoners operation. Or the property of an "absolute" dependency which I can tie
Background:
I am doing a type of workflow editor. The 'module' contains one or more seaports and lines that connect the module from the port to the port.
The XAML structure looks like this:
& lt; Canvas & gt; & Lt; Module left = "..." top = "..." width = "..." height = "..." & gt; & Lt; Grid & gt; & Lt; Otherelement & gt; & Lt; Somemorelayouting & gt; & Lt; Port name = "A" /> & Lt; PortName = "B" /> & Lt; / Somemorelayouting & gt; & Lt; / Otherelement & gt; & Lt; / Grid & gt; & Lt; / Module & gt; & Lt; Module left = "..." top = "..." width = "..." height = "..." & gt; & Lt; Differentsetoflayouts & gt; & Lt; Port name = "c" /> & Lt; Port name = "d" /> & Lt; / Differentsetoflayouts & gt; & Lt; / Module & gt; & Lt; Line startpoint = "{binding source = one, path = abs_position}" endpoint = "{binding source = c, path = abs_position}" /> & Lt; / Canvas & gt;
The line connects the port of the first module with the Port B of the second. The end point should be at the top left corner of the port (for the moment) "abs_position" property used in this example is not unintentionally present (I can only improve the readability instead of only X1, X2, Y1, Y2
If you want to place your container in place of children's elements Apply to the attached dependency properties for (J Sector that case, according to the panels, which code), you can force changes in the dependency property.
Dependency Property Descriptor DPD = DependencyPropertySearchTorrentProperty (canvasoftproperty, typef (canvas)); Dpd.AddValueChanged (canvas 1, new event handler (Top Changed Callback));
Comments
Post a Comment