Friday, October 16, 2009

Silverlight Hack of the Week - Auto Zoom

Justin Angel did a tweet about this and I must admit its cool and I had never even thought out this before but you can set autozoom and on zoom event in silverlight for when the browser host supports zoom on a page.

AutoZoom
Auto zoom is the simplest. hook this up in the html and this the silverlight control will be able to be zoomed as the browser zooms.

<param name="enableautozoom" value="[bool (ie true or false for the tards that dont know what a bool is]"/>

http://msdn.microsoft.com/en-us/library/dd833074(VS.95).aspx

on zoom
so if you are using the first feature you can also then have an event handlers to do something special on zoom. the on zoom html param allows you to define an event handler on such.

<param name="onzoom" value="[functionname]"/>


http://msdn.microsoft.com/en-us/library/dd833068(VS.95).aspx

http://msdn.microsoft.com/en-us/library/system.windows.interop.content.zoomed(VS.95).aspx

all in all some simple hacks that are not so much hacks but just kind of obscure things in Silverlight.

No comments:

Post a Comment