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
<StackPanel xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation" xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" VerticalAlignment="Center" Margin="0,100,0,0"> <Image x:Name="myImage" Source="/silverlightchina.png" Height="56" Width="220" HorizontalAlignment="Center" VerticalAlignment="Center" Margin="10" /> <StackPanel HorizontalAlignment="Center"> <Grid HorizontalAlignment="Center"> <Rectangle Stroke="#FFDEE6F0" HorizontalAlignment="Left" Width="300" Height="10" RadiusX="2" RadiusY="2" StrokeThickness="1"/> <Rectangle Fill="#FF7E99C8" HorizontalAlignment="Left" VerticalAlignment="Center" StrokeThickness="0" RadiusX="0" RadiusY="0" Width="296" Height="6" x:Name="progressBar" RenderTransformOrigin="0,0.5" Margin="4"> <Rectangle.RenderTransform> <ScaleTransform x:Name="progressBarScale" /> </Rectangle.RenderTransform> </Rectangle> </Grid> <Grid HorizontalAlignment="Center"> <TextBlock x:Name="progressText" Margin="18,0,17,19" Height="26" Text="0%" FontSize="16" Opacity="0.8" VerticalAlignment="Bottom" TextAlignment="Right"/> <TextBlock x:Name="progressText2" Margin="18,0,7,8" Height="70" Text="0%" FontSize="50" Opacity="0.04" FontWeight="Bold" VerticalAlignment="Bottom" TextAlignment="Right"/> </Grid> </StackPanel> </StackPanel>
?
轉載于:https://www.cnblogs.com/sqlite3/archive/2010/05/03/2566950.html
總結
以上是生活随笔為你收集整理的SilverLight非托管代码的初始化进度条方法的全部內容,希望文章能夠幫你解決所遇到的問題。
- 上一篇: Cheatsheet: 2010 04.
- 下一篇: Windows Server 2003