Is it possible to get to know about annotation selection when pttoolmanager is currently in CreateTool Mode?

I am developing a Xamarin.Forms app and I want to lock pttoolmanager to specific tool type until user explicitly choose to exit out ( to PTPanTool).

I did achieve that behaviour with the line ‘toolManager.Tool.BackToPanToolAfterUse = false;’

But by doing so the PTToolmanager is not able to see that an annotation got tapped when user tap on top of the existing annotation

Is it possible to have an api to inform integrators about an annotation being tapped so that they can make use of it?

Or is there any other way it is possible and I am missing?


When locking the tool manager to a specific tool type and using BackToPanToolAfterUse = false, the current tool class is responsible for handling taps and touches. Some tools, like the text highlight create tool, will select existing text highlight annotations when tapped but not other annotation types.

If you’d like to select arbitrary annotations while in any tool, you can implement the PTToolManager’s HandleTap method, which is called first before any tool can handle the tap:

public override bool HandleTap(PTToolManager toolManager, UITapGestureRecognizer gestureRecognizer) { CGPoint location = gestureRecognizer.LocationInView(this.PdfViewCtrl); pdftronprivate.PTAnnot _annot = this.PdfViewCtrl.GetAnnotationAt((int)location.X, (int)location.Y, 1, 1); Annot annot = TypeConvertHelper.ConvAnnotToManaged(_annot); if (annot.IsValid()) { return toolManager.SelectAnnotation(_annot, (nuint)this.PdfViewCtrl.GetCurrentPage()); } return false; }

Thanks for the response it really helped us to implement the tool lock mode.