protected IEnumerable <WNavigationViewItem> GetNavigationViewItems(MauiNavigationView navigationView) { if (navigationView.MenuItems?.Count > 0) { foreach (var menuItem in navigationView.MenuItems) { if (menuItem is WNavigationViewItem item) { yield return(item); } } } else if (navigationView.MenuItemsSource != null && navigationView.TopNavMenuItemsHost != null) { var itemCount = navigationView.TopNavMenuItemsHost.ItemsSourceView.Count; for (int i = 0; i < itemCount; i++) { UI.Xaml.UIElement uIElement = navigationView.TopNavMenuItemsHost.TryGetElement(i); if (uIElement is WNavigationViewItem item) { yield return(item); } } } }
public static Task <IScreenshotResult> CaptureAsync(this IScreenshot screenshot, UI.Xaml.UIElement element) => screenshot.AsPlatform().CaptureAsync(element);