문제

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

도움이 되었습니까?

해결책

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

MyButton.Tap += onTouch;
라이센스 : CC-BY-SA ~와 함께 속성
제휴하지 않습니다 StackOverflow
scroll top