#35 Close toast when app is suspended or closed: lastly, added WP8 (fix)

This commit is contained in:
EddyVerbruggen 2015-05-21 22:15:44 +02:00
parent d175358f36
commit 39dd68c7c0

View File

@ -90,7 +90,10 @@ namespace WPCordovaClassLib.Cordova.Commands
pgrid.Width = Application.Current.Host.Content.ActualWidth - 80; pgrid.Width = Application.Current.Host.Content.ActualWidth - 80;
b.Child = pgrid; b.Child = pgrid;
this.hide(null); if (popup != null && popup.IsOpen)
{
popup.IsOpen = false;
}
popup = new Popup(); popup = new Popup();
popup.Child = b; popup.Child = b;
@ -144,10 +147,13 @@ namespace WPCordovaClassLib.Cordova.Commands
public void hide(string options) public void hide(string options)
{ {
if (popup != null && popup.IsOpen) Deployment.Current.Dispatcher.BeginInvoke(() =>
{ {
popup.IsOpen = false; if (popup != null && popup.IsOpen)
} {
popup.IsOpen = false;
}
});
} }
private async void hidePopup(int delay) private async void hidePopup(int delay)