Get and set angle/rotation on runtime in Silverlight
I would like to request some help, because I'm getting crazy I already have tried the following:
var t = (CompositeTransform)var OriginalAngle = t.Rotation;
and
var _originalAngle = (double)RenderTransform.GetValue(RotateTransform.AngleProperty);
开发者_JS百科
But I'm getting exceptions.
I trying to obtain the rotation angle on a constructor, I don't know if make any difference.
Try adding a name to the RotateTransform.
<Rectangle Name="rectangle1" Stroke="Black" StrokeThickness="1" >
<Rectangle.RenderTransform>
<RotateTransform x:Name="myAngle" Angle="90" />
</Rectangle.RenderTransform>
</Rectangle>
Then to access it through code just use myAngle.Angle
精彩评论