How to set onclick listener in xamarin? : <p>I'm quite new to C# and Xamarin and have been trying to implement a bottom sheet element and don't know how to correctly do it. I am using <a href="https://github.com/fabionuno/Cocosw.BottomSheet-Xamarin.Android" rel="noreferrer">Cocosw.BottomSheet-Xamarin.Android</a> library.</p>

<p>Here is my code:</p>

<pre><code>Cocosw.BottomSheetActions.BottomSheet.Builder b = new Cocosw.BottomSheetActions.BottomSheet.Builder (this);
b.Title ("New");
b.Sheet (Resource.Layout.menu_bottom_sheet)
</code></pre>

<p>Now i think i should use <code>b.Listener(...)</code>, but it requires an interface <code>IDialogInterfaceOnClickListener</code> as a paramater and i don't know how to do it in C# correctly.</p>

<p>In Java i could write </p>

<pre><code>button.setOnClickListener(new View.OnClickListener() {
    public void onClick(View v) {
        // Perform action on click
    }
});
</code></pre>

<p>I tried doing this:</p>

<pre><code>class BottomSheetActions : IDialogInterfaceOnClickListener {
    public void OnClick (IDialogInterface dialog, int which) {
        Console.WriteLine ("Hello fox");
    }

    public IntPtr Handle { get; }

    public void Dispose() {

    }
}
</code></pre>

<p>and then this:</p>

<pre><code>b.Listener (new BottomSheetActions());
</code></pre>

<p>But it didnt work.</p>
