Quantcast
Channel: Xamarin.Forms — Xamarin Community Forums
Viewing all articles
Browse latest Browse all 91519

Context Actions - How can you get the object for the row where the context action was executed?

$
0
0

I have been searching around and found a few examples of using Context Actions however none of the ones I found interact with the underlying ViewCell's bound object. Basically, when I swipe (using iOS) and click Delete, I want to delete the object from the collection that is bound to this particular cell in the list.

I know it must be something obvious that I am just missing. it doesn't appear to be available in the sender (MenuItem)

` <ViewCell.ContextActions>

</ViewCell.ContextActions>

   public void OnCall(object sender, EventArgs e)
    {
        var mi = ((MenuItem)sender);
        DisplayAlert("Call Context Action", mi.CommandParameter + " Call context action", "OK");
    }

`

Thanks in advance.

Carl


Viewing all articles
Browse latest Browse all 91519

Trending Articles



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