I want to create Label with click possibility like in WIN phone xaml
Is there a possibili
XAML code would be as follows:
<Label
Text="My Text to click"
HorizontalOptions="Center" >
<Label.GestureRecognizers>
<TapGestureRecognizer
Tapped="OnLabelTapped"
NumberOfTapsRequired="2" />
</Label.GestureRecognizers>
</Label>
Note: By default, NumberOfTapsRequired
is 1.
Then in your .cs
file, add the method OnLabelTapped
.
public void OnLabelTapped(object sender, EventArgs args)
{
// Your code here
// Example:
// DisplayAlert("Message", "You clicked on the label", "OK");
}