Adam Zastawski

My Personal Blog

Silverlight Plugin Vertical Resize Issue..

Posted by Adam

Recently I was working on a Silverlight application and I found that the plugin was having trouble adapting to vertical resize actions.  At first it was very confusing because the plugin would adjust with the browser when resized diagonally or horizontally.  What was even more troubling was that the ?SizeChanged? and ?LayoutUpdated? events were not firing on the vertical resize.  The horizontal and vertical alignment was set to stretch.

After consulting with some friends and examining the pages that are generated for you in Visual Studio we determined that the <Body /> tag in the .aspx page was missing some style attributes. Namely the ?Height?.

		<body style="height:100%;margin:0;">	
	

That fixed it. After adding that back in the plugin was able to resize as expected AND the SizeChanged as well as the LayoutUpdated event started firing. Hope this helps you.

Posted on: 3/26/2009 at 8:44 PM
Tags: , , ,
Categories: .Net | RIA | Silverlight
Actions: E-mail | Kick it! | DZone it! | del.icio.us
Post Information: Permalink | Comments (3) | Post RSSRSS comment feed

Comments

Adam United States

Wednesday, April 08, 2009 8:24 AM

Adam

In IE8 the "height=100%" hack has no effect. lt's interesting that in IE8 the Resized and LayoutChanged events do fire, so if you aren't emulating IE7 you might have to adapt to the size changes in code... this seems less than optimal..

To emulate IE7 add the following Meta Tag
[quote]
<meta http-equiv="X-UA-Compatible" content="IE=EmulateIE7" />[/quote]

Thierry Ireland

Saturday, May 02, 2009 6:22 PM

Thierry

Hi Adam,

Thanks for this post!! This is so frustrating. I've spent hours and hours looking at getting rid of this problem as it was really annoying me seeing this small overflow at the bottom of my page. Again, read articles after articles on how to fix this problem and none worked until I tried what you suggested with the metatag, and finally my problem got sorted.

Thanks again for sharing this information and while I appreciate that Microsoft have their hands full with Silverlght (and every thing else their are doing!), you wish that this workaround would have been found a lot easier to find on codeplex, ms support, etc... or that microsoft would release a hotfix for it asap. Pain to waste so much time having to research problems like these, but thank god for the internet and of course people like you publishing their findings :).

Thanks again.

Thierry

article directory United Kingdom

Wednesday, December 23, 2009 5:27 PM

article directory

THANKS!  Was losing my mind there.  Your fix works.  John

Add comment


(Will show your Gravatar icon)

  Country flag


  • Comment
  • Preview
Loading