WISE OWL EXERCISES
WPF - VISUAL C# EXERCISES
WPF - Visual C# | Basic binding exercise | Bind the Rotation Angle of Rectangles to a Textbox
This exercise is provided to allow potential course delegates to choose the correct Wise Owl Microsoft training course, and may not be reproduced in whole or in part in any format without the prior written consent of Wise Owl.
The answer to the exercise will be included and explained if you attend the relevant Wise Owl course (sadly, only in the UK for now).
You need a minimum screen resolution of about 700 pixels width to see our exercises. This is because they contain diagrams and tables which would not be viewable easily on a mobile phone or small laptop. Please use a larger tablet, notebook or desktop computer, or change your screen resolution settings.
Open the window in the above folder, and set it to be the default one for your application. When you run your application, you should see some rectangles:
At this stage it doesn't matter what you type in as an angle - it won't have any effect on the rectangles.
Now change the angle of the transforms so that instead of being hard-coded to 20, it takes the value typed into the textbox (you need to set the ElementName and Path attributes of the RotateTransforms' Angle properties!).
You'll need to give the textbox a Name property first.
As always, it's the render transform which will look strangest (the colours have been changed to show this):
|0 degrees||60 degrees|
Close down this window!