How should you complete the code?

DRAG DROP
On the details page, you render the picture of the computer inside an object of the Rectangle type.
You need to implement the ability to rotate the rectangle that contains the picture.
How should you complete the code? To answer, drag the appropriate code elements to the correct targets.
Each element may be used once, more than once, or not at all. You may need to drag the split bar between
panes or scroll to view content.
Select and Place:

DRAG DROP
On the details page, you render the picture of the computer inside an object of the Rectangle type.
You need to implement the ability to rotate the rectangle that contains the picture.
How should you complete the code? To answer, drag the appropriate code elements to the correct targets.
Each element may be used once, more than once, or not at all. You may need to drag the split bar between
panes or scroll to view content.
Select and Place:

Answer:

Explanation:
Box 1, Box 2: Get the Rectangle and its RenderTransform matrix:
Rectangle rectToMove = e.OriginalSource as Rectangle;
Matrix rectsMatrix = ((MatrixTransform)rectToMove.RenderTransform).Matrix;
Box 3, box 4, box 5: Rotate the Rectangle:
rectsMatrix.RotateAt(e.DeltaManipulation.Rotation,
e.ManipulationOrigin.X,
e.ManipulationOrigin.Y);

https://msdn.microsoft.com/library/ee649090(v=vs.100).aspx



Leave a Reply 3

Your email address will not be published. Required fields are marked *


Andriano

Andriano

wtf, this is wpf question!

Aleph

Aleph

Correct, GP. It is RenderTransform