static AppTheme PlatformRequestedTheme()
        {
            if (!Platform.HasOSVersion(13, 0))
            {
                return(AppTheme.Unspecified);
            }

            var uiStyle = Platform.GetCurrentUIViewController()?.TraitCollection?.UserInterfaceStyle ??
                          UITraitCollection.CurrentTraitCollection.UserInterfaceStyle;

            return(uiStyle switch
            {
                UIUserInterfaceStyle.Light => AppTheme.Light,
                UIUserInterfaceStyle.Dark => AppTheme.Dark,
                _ => AppTheme.Unspecified
            });
            public override async Task <PermissionStatus> RequestAsync()
            {
                EnsureDeclared();

                var status = GetPhotoPermissionStatus(PHAccessLevel.ReadWrite);

                if (status == PermissionStatus.Granted)
                {
                    return(status);
                }
#if __IOS__
                else if (status == PermissionStatus.Limited)
                {
                    PhotosUI.PHPhotoLibrary_PhotosUISupport.PresentLimitedLibraryPicker(
                        PHPhotoLibrary.SharedPhotoLibrary,
                        Platform.GetCurrentUIViewController());
                    return(status);
                }
#endif

                EnsureMainThread();

                return(await RequestPhotoPermissionStatus(PHAccessLevel.ReadWrite));
            }