title: How to get the X,Y position of a UserControl within a Canvas
body: <p>I have a simple UserControl as below - that I place in a Canvas.  I move it using Multi-touch and I want to be able to read its new X,Y postion using procedural C# code.  Ideally I would like to have X and Y as two properties or as a Point (X,Y).</p>
  
  <pre><code>&lt;UserControl x:Class="TouchControlLibrary.myControl"
               xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
               xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
               xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006" 
               xmlns:d="http://schemas.microsoft.com/expression/blend/2008" 
               mc:Ignorable="d" 
               d:DesignHeight="64" d:DesignWidth="104"&gt;
      &lt;Border Name="ControlBorder" BorderThickness="1" BorderBrush="Black"&gt;
          &lt;DockPanel Margin="1" Height="60 " Width="100"&gt;
              &lt;StackPanel  DockPanel.Dock="Left" Background="Gray"  Width="20" &gt;
                  &lt;Button Background="#FFDEDE53" Padding="0"&gt;In&lt;/Button&gt;
              &lt;/StackPanel&gt;
              &lt;StackPanel  DockPanel.Dock="Right" Background="Gray"  Width="20" &gt;
                  &lt;Button Background="#FFE8B48F" Padding="0"&gt;Out&lt;/Button&gt;
              &lt;/StackPanel&gt;
          &lt;/DockPanel&gt;  
      &lt;/Border&gt;
  &lt;/UserControl&gt;
  </code></pre>
  
  <p>I expected to create an attached property for each of 'X' and 'Y' and fill them from Canvas.Left and Canvas.Top, using binding or some form of attached property or ???.   I have spent quite some time searching for a solution, but everything I find seems to be 'not quite what is needed'.  </p>