Skip to main content
Home Forums Silverlight Programming Programming with JavaScript SilverLight Splash Screen and Using Progress Bar
3 replies. Latest Post by jay nanavati on July 2, 2009.
(0)
apalcer
Member
0 points
40 Posts
07-02-2009 12:44 PM |
Is there any way that I can get the control Progress Bar onto my splash screen? I currently have my splash screen set up as and xml file, can I use an User Control as my splash screen? I can use image and stack panel on it, but it does not like Progress Bar. I see that Progress Bar is in System.Windows.Controls library? Is there any way that I can get to that library?
ken tucker
All-Star
15736 points
2,388 Posts
07-02-2009 12:56 PM |
No you can only use silverlight 1 controls in a splash screen. This article shows to use a rectangle control to show progress.
http://msdn.microsoft.com/en-us/library/cc838130%28VS.95%29.aspx
jay nana...
Contributor
3388 points
624 Posts
07-02-2009 1:02 PM |
if you prefer managed code splash screen, than nice framework for it here:
http://www.codeplex.com/SilverlightLoader
And if you simulate progressbar using BLOCKED SCRIPT
Splash.xaml:
<Grid xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation" xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" Background="Black" xmlns:d="http://schemas.microsoft.com/expression/blend/2008" xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006" > <Grid Height="Auto" HorizontalAlignment="Center" VerticalAlignment="Center" Width="Auto"> <Rectangle x:Name="progressBarBackground" Stroke="#FF33D3D4" StrokeThickness="1" Height="14" Margin="120,0,131,104" VerticalAlignment="Bottom" Width="200"/> <Rectangle x:Name="progressBar" Fill="#FF33D3D4" Width="0" Height="14" HorizontalAlignment="Left" Margin="120,0,0,104.5" VerticalAlignment="Bottom"/> <TextBlock x:Name="progressText" Text="0%" FontSize="11" Foreground="#FFFFFFFF" Margin="0,0,0,104" Width="30" HorizontalAlignment="Center" VerticalAlignment="Bottom" Height="16"/> </Grid></Grid>
SplashProgress.jsfunction onSourceDownloadProgressChanged(sender, eventArgs){sender.findName("progressText").Text = Math.round((eventArgs.progress * 100))+ "%";sender.findName("progressBar").Width = eventArgs.progress * sender.findName("progressBarBackground").Width;}
07-02-2009 1:05 PM |
Hi, in addition to my post above, you can use Silverlight 2.0 controls in Splash screen. You just need to design your splash screen xaml in Silverlight 2 project and than put that xaml in web project and it will work. If you create splash.xaml in web project and open in Blend than you will get error that Grid is not supported. So better to create it under Silverlight project and then move to Asp.net web project.