title: How do I get or set the position of an image on a Silverlight Canvas control
body: <p>I have an Image control as the child of a Canvas control. If I load the Image control with a bitmap and set the Stretch property to Uniform, I get a centered image.  However, I can find no way to either set or retrieve the position of the Image.  Solution anyone?</p>
  
  <p>Here is some code to make understanding the problem a bit easier:</p>
  
  <pre><code>Image img = new Image();
  img.Height = maxSize.Height;
  img.Width = maxSize.Width;
  img.Stretch = Stretch.Uniform;
  img.Source = bmp;
  myCanvas.Children.Add(img);
  
  // returns 0:
  MessageBox.Show(((Image)myCanvas.Children[0]).GetValue(Canvas.LeftProperty).ToString());
  MessageBox.Show(((Image)myCanvas.Children[0]).GetValue(Canvas.TopProperty).ToString());
  
  // in order to set explicitly set the values I have to know what they are?
  Double left = {the current left value};
  Double top = {the current top value};
  ((Image)myCanvas.Children[0]).SetValue(Canvas.LeftProperty, left);
  ((Image)myCanvas.Children[0]).SetValue(Canvas.TopProperty, top);`
  </code></pre>
  
  <p>I select the code and press the {} button, but it does not work for me, neither does entering code ticks manually.</p>