Skip to main content

Microsoft Silverlight

Answered Question SilverLight Splash Screen and Using Progress BarRSS Feed

(0)

apalcer
apalcer

Member

Member

0 points

40 Posts

SilverLight Splash Screen and Using Progress Bar

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
ken tucker

All-Star

All-Star

15736 points

2,388 Posts

Re: SilverLight Splash Screen and Using Progress Bar

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 nanavati
jay nana...

Contributor

Contributor

3388 points

624 Posts

Answered Question

Re: SilverLight Splash Screen and Using Progress Bar

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.js

function onSourceDownloadProgressChanged(sender, eventArgs)
{
sender.findName("progressText").Text = Math.round((eventArgs.progress * 100))+ "%";
sender.findName("progressBar").Width = eventArgs.progress * sender.findName("progressBarBackground").Width;
}

 

Jay K Nanavaty
www.technologyopinion.com
Mark as answer if it helps. It will also help others...

jay nanavati
jay nana...

Contributor

Contributor

3388 points

624 Posts

Re: Re: SilverLight Splash Screen and Using Progress Bar

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.

Jay K Nanavaty
www.technologyopinion.com
Mark as answer if it helps. It will also help others...
  • Unanswered Question
  • Answered Question
  • Announcement
Microsoft Communities