大佬教程收集整理的这篇文章主要介绍了SilverLight-非托管代码初始化进度条显示方法,大佬教程大佬觉得挺不错的,现在分享给大家,也给大家做个参考。
</object>
在SilverLight加载时Object标签中新加入两个参数:
1.SplashScreensource属性用于标记初始屏幕xaml页
2.onsourceDownloadProgressChanged属性用于加载进度变化时的事件处理程序
程序如下:
SplashScreensource.xaml:
<Grid x:Name="LayoutRoot" BACkground="White">
<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,17,19" Height="26" Text="0%"
FontSize="16" Opacity="0.8" VerticalAlignment="Bottom" TextAlignment="Right"/>
<TextBlock x:Name="progressText2" Margin="18,7,8" Height="70" Text="0%"
FontSize="50" Opacity="0.04" FontWeight="Bold" VerticalAlignment="Bottom" TextAlignment="Right"/>
</Grid>
</StackPanel>
</Grid>
OnsourceDownloadProgressChanged
function OnsourceDownloadProgressChanged(sender,args) {
sender.findName("progressText").Text = Math.round(eventArgs.progress * 100) + "%";
sender.findName("progressText2").Text = Math.round(eventArgs.progress * 100) + "%";
sender.findName("progressBarScale").ScaleX = eventArgs.progress;
}
以上是大佬教程为你收集整理的SilverLight-非托管代码初始化进度条显示方法全部内容,希望文章能够帮你解决SilverLight-非托管代码初始化进度条显示方法所遇到的程序开发问题。
如果觉得大佬教程网站内容还不错,欢迎将大佬教程推荐给程序员好友。
本图文内容来源于网友网络收集整理提供,作为学习参考使用,版权属于原作者。
如您有任何意见或建议可联系处理。小编QQ:384754419,请注明来意。