SilverLight非托管代码的初始化进度条方法
SilverLight非托管代码的初始化进度条方法
<script type="text/javascript">
////错误处理函数
function onSilverlightError(sender, args) ...
//下载进度函数
function onSourceDownloadProgressChanged(sender, eventArgs) {
sender.findName("progressText").Text = Math.round(eventArgs.progress * 100) + "%";
sender.findName("progressText2").Text = Math.round(eventArgs.progress * 100) + "%";
sender.findName("progressBarScale").ScaleX = eventArgs.progress;
}
</script>
<body>
<div id="silverlightControlHost">
<object data="data:application/x-silverlight-2," type="application/x-silverlight-2" width="100%" height="100%">
<param name="splashscreensource" value="SplashScreen.xaml"/>
<param name="onSourceDownloadProgressChanged" value="onSourceDownloadProgressChanged" />
<param name="source" value="ClientBin/SlApp_System.xap"/>
<param name="onerror" value="onSilverlightError" />
<param name="background" value="Blue" />
<param name="minRuntimeVersion" value="3.0.40818.0" />
<param name="autoUpgrade" value="true" />
<a href="http://go.microsoft.com/fwlink/?LinkID=149156&v=3.0.40818.0" style="text-decoration: none;">
<img src="http://go.microsoft.com/fwlink/?LinkId=108181" alt="获取 Microsoft Silverlight" style="border-style: none"/>
</a>
</object><iframe id="_sl_historyFrame" style='visibility:hidden;height:0;width:0;border:0px'></iframe></div>
</body>
SplashScreen.xaml