How to make a splash screen static until the app loads then hide when app is loaded?
This is how it is in wp7 phonegap.
public partial class MainPage : PhoneApplicationPage
{
private WebBrowserHelper _browserHelper;
// Constructor
public MainPage()
{
InitializeComponent();
this.PGView.Loaded += GapBrowser_Loaded;
_browserHelper = new WebBrowserHelper(PGView.Browser);
this.PGView.Browser.ScriptNotify += Browser_ScriptNotify;
}
private void GapBrowser_Loaded(object sender, RoutedEventArgs e)
{
this.PGView.Loaded -= GapBrowser_Loaded;
Storyboard _storyBoard = new Storyboard();
DoubleAnimation animation = new DoubleAnimation()
{
From = 0,
Duration = TimeSpan.FromSeconds(0.6),
To = 90
};
Storyboard.SetTarget(animation, SplashProjector);
Storyboard.SetTargetProperty(animation, new PropertyPath("RotationY"));
_storyBoard.Children.Add(animation);
_storyBoard.Begin();
_storyBoard.Completed += Splash_Completed;
}
void Splash_Completed(object sender, EventArgs e)
{
(sender as Storyboard).Completed -= Splash_Completed;
LayoutRoot.Children.Remove(SplashImage);
}
private void Browser_ScriptNotify(object sender, NotifyEventArgs e)
{
// if a page notifies that it should not be scrollable, disable
// scrolling.
if (e.Value == "noScroll")
{
_browserHelper.ScrollDisabled = true;
}
}
}
if you only need a simple splash picture, why not change SplashScreenImage.jpg in app ?
i do not very clear why WebBrowserHelper
from your code , i can see you display your picture after mainpage loaded. because you call
_storyBoard.Begin(); in GapBrowser_Loaded event handle