How to Create Splash Screen in Windows Phone ?

Splash Screen makes your App look good when it is loading initially . It might be a good idea to have a splash screen specially for the apps that takes some time to load.

How to Create Splash Screen in Windows Phone ?

You can create Splash Screen in Windows Phone in 2 ways

1. Use static splash screen image

2. Create a animated splash screen

By default , when a Windows Phone project(Silverlight) is created , SplashScreenimage.jpg file is created ans placed in the project folder.

You can replace this image with your image with the same size (480*800) pixels and setting the Build Action property to “Content”.

You can also create a animated splash screen by following the below steps

1. In the existing Windows Phone Project , create a new user control . Ex : SplashScreen.xaml

2. Declare BackgroundWorker and Popup objects . BackgroundWorker class is defined in the namespace System.ComponentModel; and PopUp class is defined in the namespace System.Windows.Controls.Primitives.

3. In the MainPage.xaml , Specify the Popup page to the SplashScreen usercontrol and set IsOpen property to true . Thsi will make sure that the splash screen is shown . After some time , when the RunWorkerCompleted event is triggtered , the popup is closed and the MainPage.xaml is shown.

public partial class MainPage : PhoneApplicationPage
{         // Constructor
BackgroundWorker BackgroundWork;
Popup pop;
public MainPage()
{
InitializeComponent();
pop = new Popup();
pop.IsOpen = true;
pop.Child = new SplashScreen();
BackgroundWork = new BackgroundWorker();
RunProcess();
radAutoCompleteBox1.SuggestionsSource = Data.GetSuggestions();
}
private void RunProcess()
{
BackgroundWork.RunWorkerCompleted += ((r, args) => { this.Dispatcher.BeginInvoke(() => { this.pop.IsOpen = false; }); });
BackgroundWork.DoWork += ((r, args) => { Thread.Sleep(1000); });
BackgroundWork.RunWorkerAsync();
}
}

You can also add some kind of animation in the SplashScreen.xaml user control to make it more appealing …

    3 Comments

  1. jason
    April 29, 2012
    Reply

    hi,i don’t think so,i normal run,plz check ur code.
    so,i have a question:
    how to change splashscreen.jpg is not run when app is running?
    It’s running,that i write ur code in my project,
    so,what i do?

  2. April 29, 2012
    Reply

    Sry , did not understand your question … Can you elaborate a bit more ?

  3. Tony Tallman
    April 30, 2012
    Reply

    jason, you have to delete the SplashScreen.jpg file if you don’t want it to be displayed.

Leave A Reply

Your email address will not be published. Required fields are marked *

You May Also Like

In this post, you’ll learn about the Win32 Error “0x000019E5 – ERROR_COULD_NOT_RESIZE_LOG” that you get when debugging system erors in...
In this post, you’ll learn about the error “CO_E_DBERROR 0x8004E02B” that is returned when working with COM based APIs or...
In this post, you’ll learn about the Win32 Error “0x000019D0 – ERROR_LOG_BLOCK_VERSION” that you get when debugging system erors in...