Skip to content

Commit 5d84e70

Browse files
committed
Adding support for shell
1 parent cca8718 commit 5d84e70

File tree

1 file changed

+7
-2
lines changed

1 file changed

+7
-2
lines changed

src/DIPS.Xamarin.UI/Controls/Toast/ToastCore.cs

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -148,9 +148,14 @@ private static ContentPage GetCurrentContentPage()
148148

149149
if (Application.Current.MainPage is Shell shellPage)
150150
{
151-
if (shellPage.Parent is ContentPage shellParent)
151+
if (shellPage.CurrentPage.Navigation.ModalStack.LastOrDefault() is ContentPage shellContentPage)
152152
{
153-
return shellParent;
153+
return shellContentPage;
154+
}
155+
156+
if (shellPage.CurrentPage is ContentPage shellCurrentContentPage)
157+
{
158+
return shellCurrentContentPage;
154159
}
155160
}
156161

0 commit comments

Comments
 (0)