How do you detect the click on SearchBar search icon that opens the search textbox?

dg2k 1,161 Reputation points

I couldn't find any associated event(s) that will enable me to detect when the search icon is tapped and textbox is opened to type in search keyword for the SearchBar control.

Is there a workaround for this?

A Microsoft open-source framework for building native device applications spanning mobile, tablet, and desktop.
1,418 questions
0 comments No comments
{count} votes

Accepted answer
  1. Yonglun Liu (Shanghai Wicresoft Co,.Ltd.) 16,621 Reputation points Microsoft Vendor


    There is no such an API to detect click event on search icon of SearchBar, even if on native Android or iOS platfroms.

    For instance on Android, access to the searchbar icon has been restricted, you need to find its id in Android to find it.

    If you want to implement this functionality, then using custom controls would be a better approach.

    You could refer to Create a custom control using handlers to get more details.

    Best Regards,

    Alec Liu.

    If the answer is the right solution, please click "Accept Answer" and kindly upvote it. If you have extra questions about this answer, please click "Comment".

    Note: Please follow the steps in our documentation to enable e-mail notifications if you want to receive the related email notification for this thread.

    0 comments No comments

0 additional answers

Sort by: Most helpful