title: Cannot implicitly convert type 'double' to 'System.Windows.HorizontalAlignment'. An explicit conversion exists (are you missing a cast?)
body: <p>Im trying to align an <code>Image</code> to the center of the <code>Grid</code> cell. The <code>Image</code> is within a <code>Canvas</code>. How do I go about doing this?</p>
  
  <pre><code>private void image()
  {
      Image myBarCode = new Image();
      myBarCode.Width = 400;
      myBarCode.Height = 300;
      myBarCode.HorizontalAlignment = Left;
      myBarCode.Source = new BitmapImage(new Uri("C:/Users/mark/Desktop/resident images/Doris.jpg", UriKind.RelativeOrAbsolute));
      mainCanvas1.Children.Add(myBarCode);
  }
  </code></pre>