title: Bind to element's position relative to a parent in WPF
body: <p>I need something to get the position of a sub-sub element relative to the container. TransformToAncestor does that. However, the element and subelements move, resize change, their layout, etc. I need a way to keep the position up-to-date. Like an event if anything happend that would affect my TransformToAncestor operation. Or an "AbsolutePosition" dependency property I can bind to.</p>
  
  <p>Background:</p>
  
  <p>I'm doing sort of a work flow editor. 
  There are 'modules' that have one or more ports and lines that connect the modules from port to port.</p>
  
  <p>The XAML stucture looks like this:</p>
  
  <pre><code>&lt;Canvas&gt;
    &lt;Module Left="..." Top="..." Width="..." Height="..."&gt;
      &lt;Grid&gt;&lt;otherelement&gt;&lt;somemorelayouting&gt;
        &lt;Port Name="a" /&gt;
        &lt;Port Name="b" /&gt;
      &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" /&gt;
      &lt;Port Name="d" /&gt;
      &lt;/differentsetoflayouts&gt;
    &lt;/Module&gt;
    &lt;Line startpoint="{binding source=a, path=abs_position}" endpoint="{binding source=c, path=abs_position}" /&gt;
  &lt;/Canvas&gt;
  </code></pre>
  
  <p>The line connects port a of the first module with port b of the second. The end points should be at the top left corner of the port-element (for the moment). This "abs_position" property used in this example does unfurtunatly not exist (I'm using start/endpoint here instead of X1,X2,Y1,Y2 only to improve readability)</p>