Skip to main content
Home Forums Silverlight Programming Programming with .NET - General RenderTransforms on Childs
3 replies. Latest Post by metal on November 11, 2008.
(0)
hammadmirza
Member
324 points
107 Posts
11-11-2008 5:17 AM |
Hi, i have a drawing application, with zooming option and i have resizing and rotating controls on elements (that can be placed on drawing canvas). But when i zoom in/out the canvas zooms (OK) and the elements (OK) but the rotating and resizing controls also scale+/-. But this doesnt happen in Good drawing applications, rotating and resizing controls maintain their size no matter what is the zoom value. I got an idea to apply the reverse scale transform, when the zoom value is changed, on the rotate and resize controls. But suppose there are 100 elements on canvas, how everyone of them can be notified that "Please reverse the scale transform" If anyone has some suggestions. Thanks
peterdungan
223 points
150 Posts
11-11-2008 7:31 AM |
Place the zoom controls outside of the canvas that you apply the transform to.
11-11-2008 7:50 AM |
No that is not the solution, as i will lose the zooming on the elements then!
Actually i have a Control that handles resize/rotation, and the shapes/elements to be drawn are added into that control.
metal
Participant
1243 points
262 Posts
11-11-2008 8:41 AM |
I can see no way around looping through either the visual tree or a List of your types that you build ass they are added.
foreach (UIElement obj in LayoutRoot.Children) { if (obj is MyProject.MyImageContainer) { obj.ReverseScaling(); } }
foreach (MyImageContainer obj in MyImageContainers) { obj.ReverseScaling(); }