A silverlight pluggin area won't grow/shrink while zoom-IN/OUT the Internet Explorer window. This functionality can be achieved as follows
This is a straight forward approach and pretty simple
1. Register your Class
2. Create the Method to be called from IE Javascript with the ScriptableMember attribute
public partial class Page : UserControl
{
public Page()
{
InitializeComponent();
HtmlPage.RegisterScriptableObject("page", this);
}
[ScriptableMember]
public void ResizePage(double Height, double Width)
{
LayoutRoot.Height = Height;
LayoutRoot.Width = Width;
}
}
3.Create a javascript function in the html page where in the silverlight pluggin is used
function onResize(sender, args) {
var slControl = document.getElementById("slControl");
var height, width;
height = slControl.Content.ActualHeight;
width = slControl.Content.ActualWidth;
slControl.Content.page.ResizePage(height, width);
}
4.Call this method in the onresize method of the html object tag as
<object id="slControl" data="data:application/x-silverlight-2," type="application/x-silverlight-2" width="50%" height="50%">
<param name="source" value="ClientBin/SilverlightNet.xap"/>
<param name="onerror" value="onSilverlightError" />
<param name="background" value="white" />
<param name="minRuntimeVersion" value="2.0.31005.0" />
<param name="autoUpgrade" value="true" />
<param name="onresize" value="onResize" />
<a href="http://go.microsoft.com/fwlink/?LinkID=124807" style="text-decoration: none;">
<img src="http://go.microsoft.com/fwlink/?LinkId=108181" alt="Get Microsoft Silverlight" style="border-style: none"/>
</a>
</object>
You are done. Now the Silverlight content will Grow/Shrink with the zoom in/out
Reference : http://www.microsoft.com/Web/content.aspx?id=browser-resize-zoom