Reputation: 578
I've added some UIelements (buttons) programatically to my application interface and i'd like to handle tap events.
I would have done it in my xaml file with
<Button Tap="onTap"/>
How could I do it in C# ? I don't know how i shall use Button.Tap=....
I Have prepared the handler like that :
private void onTouch(object sender, System.Windows.Input.GestureEventArgs e)
{
//Cool stuff here
}
Thank you in advance
Upvotes: 1
Views: 1162
Reputation: 89285
You can use +=
to attach event handler in C# :
MyButton.Tap += onTouch;
Upvotes: 1