I attempted to display the GettingStarted xaml page for the SfPdfViewer control (https://help.syncfusion.com/xamarin/sfpdfviewer/getting-started) as a modal dialog in Xamarin Forms but I ran into two issues: (1) it errors on double-tap (with or without the DoubleTapped setting in XAML) and (2) it displays at max zoom level at the start (it can be manually unzoomed by unpinching but this should be unnecessary).
The double-tap error is as follows:
Message: Object reference not set to an instance of an object
Source: Syncfusion.SfPdfViewer.XForms.iOS
StackTrace: at Syncfusion.SfPdfViewer.XForms.iOS.ScrollViewEx.OnDoubleTap (UIKit.UIGestureRecognizer gesture) [0x00021] in <68e0739786774eedac78f1480b2a97bd>:0
at UIKit.UITapGestureRecognizer+Callback.Activated (UIKit.UITapGestureRecognizer sender) [0x00000] in /Library/Frameworks/Xamarin.iOS.framework/Versions/12.2.1.10/src/Xamarin.iOS/UIKit/UIGestureRecognizer.cs:205
at (wrapper managed-to-native) UIKit.UIApplication.UIApplicationMain(int,string[],intptr,intptr)
at UIKit.UIApplication.Main (System.String[] args, System.IntPtr principal, System.IntPtr delegate) [0x00005] in /Library/Frameworks/Xamarin.iOS.framework/Versions/12.2.1.10/src/Xamarin.iOS/UIKit/UIApplication.cs:79
at UIKit.UIApplication.Main (System.String[] args, System.String principalClassName, System.String delegateClassName) [0x0002c] in /Library/Frameworks/Xamarin.iOS.framework/Versions/12.2.1.10/src/Xamarin.iOS/UIKit/UIApplication.cs:63
at CrxMobile.iOS.Application.Main (System.String[] args) [0x00002] in C:\Users\tscheffel\Source\Repos\CrxMobile\CrxMobile.iOS\Main.cs:15
Code to display the GettingStarted page as a modal dialog is as follows. I can display other XAML pages as modal dialogs with no issues (though they do not contain the the SfPdfViewer control).
var pdfViewerPage = new GettingStarted();
pdfViewerPage.ToolbarItems.Add(new ToolbarItem { Text = "Close", Icon = "Close", Command = new Command(() => App.Current.MainPage.Navigation.PopModalAsync()) });
var modalDialog = new NavigationPage(pdfViewerPage);
await App.Current.MainPage.Navigation.PushModalAsync(modalDialog);
Parameters:
License: Essential Studio Xamarin
Syncfusion.Xamarin.Core 16.3.0.36
Syncfusion.Xamarin.SfPdfViewer 16.3.0.36
VS2017 Professional 15.9.3
Xamarin 4.12.3.73
Xamarin.iOS & Xamarin.Mac SDK 12.2.1.11
Thanks for your time!
Troy