Skip to content

Commit

Permalink
Update PrismApplicationBase.cs
Browse files Browse the repository at this point in the history
  • Loading branch information
AmrAlSayed0 committed Nov 6, 2019
1 parent aab10a4 commit c9a11d9
Showing 1 changed file with 10 additions and 6 deletions.
16 changes: 10 additions & 6 deletions Source/Xamarin/Prism.Forms/PrismApplicationBase.cs
Original file line number Diff line number Diff line change
Expand Up @@ -230,16 +230,20 @@ protected virtual void InitializeModules()

protected override void OnResume()
{
if (MainPage == null) return;
var page = PageUtilities.GetCurrentPage(MainPage);
PageUtilities.InvokeViewAndViewModelAction<IApplicationLifecycleAware>(page, x => x.OnResume());
if (MainPage != null)
{
var page = PageUtilities.GetCurrentPage(MainPage);
PageUtilities.InvokeViewAndViewModelAction<IApplicationLifecycleAware>(page, x => x.OnResume());
}
}

protected override void OnSleep()
{
if (MainPage == null) return;
var page = PageUtilities.GetCurrentPage(MainPage);
PageUtilities.InvokeViewAndViewModelAction<IApplicationLifecycleAware>(page, x => x.OnSleep());
if (MainPage != null)
{
var page = PageUtilities.GetCurrentPage(MainPage);
PageUtilities.InvokeViewAndViewModelAction<IApplicationLifecycleAware>(page, x => x.OnSleep());
}
}

private void PrismApplicationBase_ModalPopping(object sender, ModalPoppingEventArgs e)
Expand Down

0 comments on commit c9a11d9

Please sign in to comment.