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
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
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?
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
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
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