たぶん一番書くやつを
で比較。
//MainActivity.java
button1.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View view) {
label1.setText("pushed!!");
}
});
//MainActivity.cs
buttonOk.Click += (_, e)
=> label1.Text = "pushed!!";
//ViewController.swift
buttonOK.addTarget(self, action:
#selector(ViewController.onTouch(_:)),
forControlEvents: .TouchUpInside)
・・・
func onTouch(sender: AnyObject) {
label1.text = "pushed!!"
}
//ViewColtroller.cs
buttonOk.TouchUpInside += (_, e)
=> label1.Text = "pushed!!";
Xamarin はいいぞ!