private void EventClickedHandler(object sender, EventArgs e) {
var button = (Button)sender;
var classId = button.ClassId;
// This will give you the value / classId of your button which you'll press
DisplayAlert("Hi", classId.ToString(), "Alright");
}
1条答案
按热度按时间bqjvbblv1#
假设您有两个按钮,如下所示:
现在只需像这样在这些按钮控件中添加Class id
然后在click事件处理程序中编写以下代码: