just a simple thing really...
now the page i use has no html other than the stuff that puts the sl in the page.
then my xaml root looks kinda like this:
<UserControl
... name spaces and stuff...
SizeChanged="UserControl_SizeChanged" >
<StackPanel x:Name="LayoutRoot" >
.... rest of the page ....
</>
</>
then in the .cs i have:
private void UserControl_SizeChanged(object sender, SizeChangedEventArgs e) {
try {
LayoutRoot.Width = e.NewSize.Width;
LayoutRoot.Height = e.NewSize.Height;
DetailsPnl.Width = e.NewSize.Width - 10;
ScrollV.Height = e.NewSize.Height - 72;
} catch (Exception ex) {
string foo = ex.StackTrace;
}
}
the try/catch is for invalid sizes like whenn the user tries to make the page really small.
the two child controls i had to adjust a bit to keep them in the visible area.
my .aspx has a tyiny bit of css like this:
<style type="text/css">
html, body {
height: 100%;
overflow: auto;
}
body {
padding: 0;
margin: 0;
}
#silverlightControlHost {
height: 100%;
text-align:center;
}
</style>
...
<form id="form1" runat="server" style="height:100%">
<div id="silverlightControlHost">
so far this works in ie 7/8 and safari w/o any issues.
not super tested ... not checked in ie6 or fire fox etc...