I want my Silverlight app to fill the entire browser window. I\'ve set the plugin object width and height to 100%, and set my LayoutRoot container\'s height and width to Aut
If you've got a fairly complex HTML layout and can't rely on fixed positioning then you can make the #silverlightControlHost div resize using the following:
private bool _hasResized;
protected override Size ArrangeOverride(Size finalSize)
{
if (!_hasResized)
{
HtmlPage.Document.GetElementById("silverlightControlHost").SetStyleAttribute("height", finalSize.Height.ToString());
_hasResized = true;
}
return base.ArrangeOverride(finalSize);
}
You can put this inside MainPage.cs
or if you have nested UserControls
, then the control that requires the most height. I'm also using the following XAML and the default HTML Visual Studio provides
I haven't tested it without these settings, as far as I know Auto is the default.