Frage

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

War es hilfreich?

Lösung

You can use += to attach event handler in C# :

MyButton.Tap += onTouch;
Lizenziert unter: CC-BY-SA mit Zuschreibung
Nicht verbunden mit StackOverflow
scroll top