What I\'m doing is this
Button button1 = FindViewById
The real issue here is in your SetOnClickListener
you are setting an inline anonymous class implementing OnClickListener
interface.
This is not supported in C#, From the C# programming guide, you can find,
Anonymous types are class types that consist of one or more public read-only properties. No other kinds of class members such as methods or events are allowed. An anonymous type cannot be cast to any interface or type except for object.
But it doesn't mean that you cannot use SetOnClickListener
at all.
You can either do button1.SetOnClickListener(this)
and implement your OnClickListener
in the same class
or
create a class (can be inner class) implements OnClickListener
with your implementation and pass an it's instance to your SetOnClickListener
In both ways, your are obeying C#'s "Real Name Policy" :)