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

Zoom in Diagram should not affect other UI elements

5 Answers 89 Views
Diagram
This is a migrated thread and some comments may be shown as answers.
Tulio
Top achievements
Rank 1
Tulio asked on 01 Feb 2019, 07:13 PM

Hi!

 

I am using RadDiagram where we have custom controls that show up on the mouse hover of some shapes.

When we zoom and create these custom controls, the zoom affects our custom controls as well (which has buttons and text, making them unusable)

 

I've tried to use the layouttransform to my control:

LayoutTransform="{Binding ElementName=Shape, Path=LayoutTransform.Inverse}"/>

 

But it didn't work. Any ideas?

5 Answers, 1 is accepted

Sort by
0
Dinko | Tech Support Engineer
Telerik team
answered on 06 Feb 2019, 12:55 PM
Hello Tulio,

RadDiagram applies a scale transformation to all shapes when users zoom in or out. This is why all the components of the shape are scaled. I am assuming that you have placed the custom controls inside the shapes. Correct me if I am wrong. Currently, there is no built-in mechanism to restrict some shapes from zooming. 

What you could try as a workaround is to subscribe to the ZoomChanged event and create custom logic to manually scale your elements depending on the current zoom level.

Regards,
Dinko
Progress Telerik
Get quickly onboarded and successful with your Telerik and/or Kendo UI products with the Virtual Classroom free technical training, available to all active customers. Learn More.
0
Tulio
Top achievements
Rank 1
answered on 13 Feb 2019, 07:22 PM

Hi Dinko,

 

Yes, this control is a popup control that shows up when mouse is hovered on a shape.

Usually for this type of problem, the following solution works:

<Button LayoutTransform="{Binding ElementName=MainGrid, Path=LayoutTransform.Inverse}"/>

Any reason why it isn't working in this case?

 

 

 

0
Dinko | Tech Support Engineer
Telerik team
answered on 18 Feb 2019, 11:58 AM
Hi Tulio,

The zooming internal logic is performed on every element inside the diagram surface and there is no built-in logic to prevent scaling specific item. I have double check you scenario by showing Popup when the mouse is over a shape and the content inside the Popup is not scaled as the Popup is not an element of the RadDiagram. Check the attached project for further references. You could try the same approach inside your application if it is applicable. Hope it will work.

Regards,
Dinko
Progress Telerik
Get quickly onboarded and successful with your Telerik and/or Kendo UI products with the Virtual Classroom free technical training, available to all active customers. Learn More.
0
Tulio
Top achievements
Rank 1
answered on 19 Feb 2019, 06:18 PM

Hi Dinko,

Thanks for the project!

The difference in my scenario is that my popup is defined inside the datatemplate of the ShapeDiagram as it uses this to get the binding for that specific item.
So your proposed solution doesn't really work unless I want add a bit of extra logic to maintain the diagramshape item that is being hovered.

Is there a way to bypass the zoom for an item that is defined inside the datatemplate of the RadDiagramShape ?

 

Thanks

0
Accepted
Dinko | Tech Support Engineer
Telerik team
answered on 22 Feb 2019, 11:23 AM
Hi Tulio,

I understand that the suggested approach will require additional code to fit your scenario. I am afraid that with the current implementation of the zooming service of the diagram, I can't suggest another approach which you can use to restrict shape from zooming. 

Regards,
Dinko
Progress Telerik
Get quickly onboarded and successful with your Telerik and/or Kendo UI products with the Virtual Classroom free technical training, available to all active customers. Learn More.
Tags
Diagram
Asked by
Tulio
Top achievements
Rank 1
Answers by
Dinko | Tech Support Engineer
Telerik team
Tulio
Top achievements
Rank 1
Share this question
or