Hello. I have created a context menu with two options, rotate image 90 degrees clockwise and rotate image 90 degrees counterclockwise. The method I am using to rotate works the first time, but will not continue to rotate the object, in the same direction, on subsequent tries. I want the user to be able to rotate the image in 90 degree increments until the image has gone around 360 degrees, if need be. Here is what I have tried:
private void RotateCW (object sender, RoutedEventArgs e)
{
RotateTransform cwRotateTransform = new RotateTransform(); View2.RenderTransform = cwRotateTransform;
if (cwRotateTransform.Angle == 360)
cwRotateTransform.Angle=0;
else cwRotateTransform.Angle +=90;
}
Thanks in advance for any help on this.