From 1f50d90d9e3ae6bb44df24f92bc06bb247fd4608 Mon Sep 17 00:00:00 2001
From: Nadya Atanasova <nadya.it@gmail.com>
Date: Thu, 19 Jun 2014 12:21:48 +0300
Subject: [PATCH] fixes Splashscreen crash on WP8

The UI elements cannot be accessed from any other than the UI thread directly. So, enclose UI access code in the Dispatcher.BeginInvoke()
---
 src/wp/SplashScreen.cs | 20 ++++++++++----------
 1 file changed, 10 insertions(+), 10 deletions(-)

diff --git a/src/wp/SplashScreen.cs b/src/wp/SplashScreen.cs
index da519d5..4d3545b 100644
--- a/src/wp/SplashScreen.cs
+++ b/src/wp/SplashScreen.cs
@@ -95,13 +95,13 @@ namespace WPCordovaClassLib.Cordova.Commands
 
         public void show(string options = null)
         {
-            if (popup.IsOpen)
-            {
-                return;
-            }
-
             Deployment.Current.Dispatcher.BeginInvoke(() =>
             {
+                if (popup.IsOpen)
+                {
+                    return;
+                }
+
                 popup.Child.Opacity = 0;
 
                 Storyboard story = new Storyboard();
@@ -137,13 +137,13 @@ namespace WPCordovaClassLib.Cordova.Commands
 
         public void hide(string options = null)
         {
-            if (!popup.IsOpen)
-            {
-                return;
-            }
-
             Deployment.Current.Dispatcher.BeginInvoke(() =>
             {
+                if (!popup.IsOpen)
+                {
+                    return;
+                }
+
                 popup.Child.Opacity = 1.0;
 
                 Storyboard story = new Storyboard();