Windows Store App Visual Basic Rotate Object with code
- by Ajay Raghav
How to rotate an ellipse (or any other object) with VB code? In XAML, I designed an ellipse and easily rotated it from the properties (Transform - Rotate - Angle). When I am trying to do it with VB code, I cannot locate the rotate/angle property of that ellipse. So, I tried this:
Dim Rotator As RotateTransform
Rotator.Angle = 90
Ellipse1.RenderTransform = Rotator
It didn’t work. It says:
Unable to cast object of type 'Windows.UI.Xaml.Media.MatrixTransform' to type 'Windows.UI.Xaml.Media.RotateTransform'.
I think I’m close to the right way. Please give me a push.
Thanks