Sunday, February 22, 2009

Silverlight: MultScaleImage Catches All Events On Page

As the version 2.5, Deep Zoom Composer has a good option for beginner coders to play with it's output's source code, including the both XAML and C# ones. These days many people choose to start developing nice photo shows with it's original output.

However, if you decide to add extra functionality such as buttons etc., you may face that MultiScaleImage (the Deep Zoom area) catches every click on whole page, even it is located in a seperate canvas apart from other elements.

This problem is caused by the original output generator. By default, all mouse events are binded to page. Just go to your source code and modify this.MouseLeftButtonUp etc. events into msi.MouseLeftButtonUp. After this, MultiScaleImage will only catch its mouse events, not the unrelated ones.