Silverlight页面让浏览器出现滚动条问题?
请大家帮小弟一个忙,刚学silverlight遇到这样的一个问题。。
我在index.xaml里面写的代码
private double _minimalHeight = 1350;
void NewLayoutRoot_SizeChanged(object sender, SizeChangedEventArgs e)
{
Size size = this.NewContentRoot.DesiredSize;
if (size.Height < _minimalHeight)
{
size.Height = _minimalHeight;
}
String heightInpixel = String.Format("{0}px", size.Height);
String containerElementId = "silverlightControlHost";
HtmlElement element = HtmlPage.Document.GetElementById(containerElementId);
element.SetStyleAttribute("height", heightInpixel);
string s = element.GetStyleAttribute("height");
}
这是我在网上看的,的确可以实现上面问题可以达到目的,但是现在问题又来了,如果我在另一个xaml里面再写这个代码 把private double _minimalHeight = 850; 把这个高度改成850,是没有用的。它的高度依然是以第一个为主,如果我有很多xaml页面 并且高度都不一样,那么我现在该怎么办啊。。不知道怎么弄,急啊,请大家帮个忙,小弟不胜感激。项目进行中啊。。。