A Microsoft framework for building cross-platform mobile apps using .NET and C# with native performance and user interfaces.
Hello,
Welcome to our Microsoft Q&A platform!
You can move code from TapGestureRecognizerBack_Tapped to new method like following code. Then your Tapped event for label could invoke it, your button click could invoke it as well.
private void TapGestureRecognizerBack_Tapped(object sender, EventArgs e)
{
DoSomething();
}
private void DoSomething()
{
//Move your tap Gesture code here.
Console.WriteLine("Tapped");
}
private void Button_Clicked(object sender, EventArgs e)
{
DoSomething();
}
Best Regards,
Leon Lu
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.