We use cookies to give you the best experience on our website. If you continue to browse, then you agree to our privacy policy and cookie policy. Image for the cookie policy date

CancelTextSearchCommand not working

I'm having difficulty using the CancelTextSearchCommand in the SfPdfViewer control. I'm currently using the code provided in https://help.syncfusion.com/xamarin/sfpdfviewer/search-for-text-instance#how-to-cancel-text-search I only change the image name. The button shows up (as does the search button). However it doesn't un-highlight the text when pressed. Here is a copy of my implementation. 

In xaml
<Button x:Name="cancelSearchButton" Grid.Column="3" BackgroundColor="Black" Image="infoicon.png" HorizontalOptions="Start" VerticalOptions="Center" Command="{Binding CancelTextSearchCommand, Source={x:Reference Name=pdfViewerControl}}"/> 

In View Model (binding context)
public LinkedCommand CancelTextSearchCommand { get { return _cancelTextSearchCommand ?? (_cancelTextSearchCommand = new LinkedCommand(Mediator, (e) => 

ExecuteCancelTextSearchCommand(e))); } } 

public void ExecuteCancelTextSearchCommand(object param) { }

Thoughts and comments very welcome!

3 Replies

BS Balasubramanian Sundararajan Syncfusion Team August 22, 2017 11:46 AM UTC

Hi Simon, 

Sorry for the inconvenience caused. 

In order to cancel the text search operation you need to use `CancelSearchTextCommand` which is available in our PDF viewer control. Command name provided in the cancel search operation is incorrect in our Xamarin UG documentation. We have updated our Xamarin.Forms UG documentation with the correct content and you can refer the following link for more details, 


Also, we have created a sample for your reference which contains our PDF viewer control and the sample can be downloaded from the following link, 


Please try the above solution and let us know whether the reported issue gets resolve in your end or not. 

Thanks, 
Balasubramanian S 
 



SH Simon Haile August 22, 2017 05:27 PM UTC

Hi Balasubramanian,

Thanks for the prompt assistance with this. 'CancelSearchTextCommand' did resolve the issue on my end.

Cheers,

Simon



BS Balasubramanian Sundararajan Syncfusion Team August 23, 2017 05:36 AM UTC

Hi Simon, 
 
Thank you for your update. 
 
We are glad to know that your issue is resolved. 
 
Thanks, 
Balasubramanian S 


Loader.
Live Chat Icon For mobile
Up arrow icon