谢谢各位网友们的帮助,问题解决了,但是还是有点疑问想请教下。前台:
<object data="data:application/x-silverlight-2," type="application/x-silverlight-2" width="1100" height="650"> <param name="source" value="../ClientBin/MyCharts.xap"/>
<param name="initparams" value="ChartType=WaterMonitoring" />
<param name="onError" value="onSilverlightError" />
<param name="background" value="white" />
<param name="minRuntimeVersion" value="4.0.50826.0" />
<param name="autoUpgrade" value="true" />
<a href="http://go.microsoft.com/fwlink/?LinkID=149156&v=4.0.50826.0" style="text-decoration:none">
<img src="http://go.microsoft.com/fwlink/?LinkId=161376" alt="获取 Microsoft Silverlight" style="border-style:none"/>
</a>
</object>后台: private void Application_Startup(object sender, StartupEventArgs e)
{
string charttype = e.InitParams["ChartType"].ToString();
if (charttype == "")
{
this.RootVisual = new MainPage();
}
if (charttype == "ElecMonitoring")
{
this.RootVisual = new ElecMonitoring();
}
if (charttype == "WaterMonitoring")
{
this.RootVisual = new WaterMonitoring();
}
}问题:这样根据条件来加载“XAML页面”,每个“XAML”页面中都有个“图表”,并进行了数据绑定。1、这样做是不是比较节省资源???2、是不是没有用到的页面不被初始化,不用进行数据通信???
<object data="data:application/x-silverlight-2," type="application/x-silverlight-2" width="1100" height="650"> <param name="source" value="../ClientBin/MyCharts.xap"/>
<param name="initparams" value="ChartType=WaterMonitoring" />
<param name="onError" value="onSilverlightError" />
<param name="background" value="white" />
<param name="minRuntimeVersion" value="4.0.50826.0" />
<param name="autoUpgrade" value="true" />
<a href="http://go.microsoft.com/fwlink/?LinkID=149156&v=4.0.50826.0" style="text-decoration:none">
<img src="http://go.microsoft.com/fwlink/?LinkId=161376" alt="获取 Microsoft Silverlight" style="border-style:none"/>
</a>
</object>后台: private void Application_Startup(object sender, StartupEventArgs e)
{
string charttype = e.InitParams["ChartType"].ToString();
if (charttype == "")
{
this.RootVisual = new MainPage();
}
if (charttype == "ElecMonitoring")
{
this.RootVisual = new ElecMonitoring();
}
if (charttype == "WaterMonitoring")
{
this.RootVisual = new WaterMonitoring();
}
}问题:这样根据条件来加载“XAML页面”,每个“XAML”页面中都有个“图表”,并进行了数据绑定。1、这样做是不是比较节省资源???2、是不是没有用到的页面不被初始化,不用进行数据通信???
解决方案 »
免费领取超大流量手机卡,每月29元包185G流量+100分钟通话, 中国电信官方发货