diff --git a/Plugin.SegmentedControl.Maui/Utils/PageHelper.cs b/Plugin.SegmentedControl.Maui/Utils/PageHelper.cs index c766d56..f91130b 100644 --- a/Plugin.SegmentedControl.Maui/Utils/PageHelper.cs +++ b/Plugin.SegmentedControl.Maui/Utils/PageHelper.cs @@ -53,9 +53,12 @@ internal static IEnumerable GetNavigationTree(Page page, bool modal = fals case TabbedPage tabbedPage: yield return tabbedPage; - foreach (var p in GetNavigationTree(tabbedPage.CurrentPage)) + foreach (var tab in tabbedPage.Children) { - yield return p; + foreach (var p in GetNavigationTree(tab)) + { + yield return p; + } } break; @@ -87,4 +90,4 @@ internal static IEnumerable GetNavigationTree(Page page, bool modal = fals } } } -} \ No newline at end of file +}