title: How to force ActualWidth and ActualHeight to update (silverlight)
body: <p>I a grid on my silverlight control, I am programatically adding a canvas, and in the canvas I am loading and displaying Image.</p>
  
  <p>I'm also adding a rotation to the canvas.  The problem is that by default the CenterX and CenterY of the rotation is the top left of the canvas.  What I want is the rotation to happen around the centre of the canvas.  </p>
  
  <p>To do this, I've tried setting the CenterX and CenterY of the Rotation to the Images <code>ActualWidth</code> / 2 and <code>ActualHeight</code> / 2, however I've discovered that <code>ActualWidth</code> and <code>ActualHeight</code> are not always populated, at least not right away. How can I force them to get updated?</p>
  
  <p>Even using the DownloadProgress event on the image doesn't seem to guarantee the ActualWidth and ActualHeight are populated, and neither does using this.Dispatcher.BeginInvoke()...</p>
  
  <pre><code>Image imgTest = new Image();
  Canvas cnvTest = new Canvas();
  Uri uriImage = new Uri("myurl", UriKind.RelativeOrAbsolute);
  System.Windows.Media.Imaging.BitmapImage bmpDisplay = new System.Windows.Media.Imaging.BitmapImage(uriImage);
  
  bmpDisplay.DownloadProgress += new EventHandler&lt;System.Windows.Media.Imaging.DownloadProgressEventArgs&gt;(this.GetActualDimensionsAfterDownload);
  
  imgTest.Source = bmpDisplay;
  imgTest.Stretch = Stretch.Uniform;
  imgTest.HorizontalAlignment = HorizontalAlignment.Center;
  imgTest.VerticalAlignment = VerticalAlignment.Center;
  
  cnvTest.Children.Add(imgTest);
  
  this.grdLayout.Children.Add(imgTest);
  this.Dispatcher.BeginInvoke(new Action(GetActualDimensions)); 
  </code></pre>