views:

33

answers:

1

I want procedurally rotate an image in WPF. I've seen how to bind a rotation to a control. But, I want to bind the rotation to an object's angle. How do I do that?

+2  A: 
<Image Source="{Binding ElementName=ImageList,Path=SelectedItem.Image}">
   <Image.LayoutTransform>
      <RotateTransform Angle="{Binding RotationProperty}"/>
   </Image.LayoutTransform>
</Image>

Source + more info: http://www.nbdtech.com/Blog/archive/2007/11/15/wpf-image-viewer-part-7-rotating-the-image-with-a.aspx

bufferz