This is a migrated thread and some comments may be shown as answers.

Change the rotation behavior for shapes to be around Top Left corner instead of center

3 Answers 162 Views
Diagram
This is a migrated thread and some comments may be shown as answers.
Mohamed
Top achievements
Rank 1
Mohamed asked on 27 Apr 2017, 08:12 PM
The default rotation behavior for all shapes on the diagram works around the center of the shape. I need to change this behavior to rotate around the top left corner of the shape/shapes. I need any sample code for this.

3 Answers, 1 is accepted

Sort by
0
Accepted
Tanya
Telerik team
answered on 02 May 2017, 12:01 PM
Hello Mohamed,

To customize this behavior you will need to create a custom rotation service that calculates the rotation point to be the top left position of the shape. I am attaching a sample project showing how to achieve that. 

For more information on the tools and services of RadDiagram, you can check the following topics:

Hope this is helpful.

Regards,
Tanya
Telerik by Progress
Want to extend the target reach of your WPF applications, leveraging iOS, Android, and UWP? Try UI for Xamarin, a suite of polished and feature-rich components for the Xamarin framework, which you to write beautiful native mobile apps using a single shared C# codebase.
0
Mohamed
Top achievements
Rank 1
answered on 02 May 2017, 12:15 PM
Thanks Tanya for your sample project, it's really very helpful. 

Now, I need to change the position of rotation icon to be on the top left corner on the selected shape/s instead of its current position (top center).

0
Tanya
Telerik team
answered on 05 May 2017, 08:53 AM
Hi Mohamed,

The way to change the position of the rotation handle should be done by customizing the default ControlTemplate of the ManipulationAdorner of RadDiagram. You can find more information regarding extracting and editing default control templates in this article.
 
Regards,
Tanya
Telerik by Progress
Want to extend the target reach of your WPF applications, leveraging iOS, Android, and UWP? Try UI for Xamarin, a suite of polished and feature-rich components for the Xamarin framework, which allow you to write beautiful native mobile apps using a single shared C# codebase.
Tags
Diagram
Asked by
Mohamed
Top achievements
Rank 1
Answers by
Tanya
Telerik team
Mohamed
Top achievements
Rank 1
Share this question
or