This project is read-only.

Zoom Canvas extensibility

Aug 11, 2010 at 5:02 PM
Hi Josh, Firstly i want to thank you for sharing your code and knowledge to the community. I would like to know that is the ZoomCanvas able to hide/unhide controls based on different zoom levels? is it something that is doable based on the current code? or must i extend it? i'm trying to emulate the zoom behavior that is shown in this video whereby different UI fades in and out based on different zoom levels.... i assume they are not using the deep zoom control which in any case is only Silverlight-capable anyway.... And i would also like to know what was the laptop brand/model you used for your demo at MIX10.. Thanks so much for your contribution....
Aug 11, 2010 at 5:20 PM
Hi icube, No problem! I don't think they are using DeepZoom. The ZoomCanvas is a ContentControl, which supports only a single child. It isn't aware of individual components that may be within the child. If you subscribe to the ZoomCanvas.ViewChanged event, you can check the properties of the ZoomCanvas (such as Center and ViewScale) and make changes in your controls based upon those properties. It isn't as easy as I would like for the scenario you want to do but it is possible. I actually need to solve a similar problem for a project I'm working on. I'll see if I can make this a bit easier in my next commit. In the meantime checking the scale during ViewChanged will get you most of the way there. At MIX10 I used an HP tx2z tablet with the n-Trig digitizer. That model has been replaced by a new one with a Wacom digitizer. I haven't tested the new one yet. Josh