Quantcast
Channel: Recent Threads — Xamarin Community Forums
Viewing all articles
Browse latest Browse all 204402

How to set Button onClick event handler declaratively?

$
0
0

Hi,

Firstly, I apologise as I'm sure this has been asked many times before but I can't find an answer:

How do I set an event handler declaratively?

Currently I have in my axml a button:

That I would like to fire the method btnOneClick in my Activity1.cs:

    public void btnOneClick(View v)
    {
    }

But when I click on the button I get a message saying the application has stopped working, with no other detail.

What do I have wrong?

Cheers,

James


Viewing all articles
Browse latest Browse all 204402

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>