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

Select row and click button -Listview

$
0
0

I have a listview bound to items collection in view model. The list cell has button and a stepper control for quantity of each item. I want to be able to get the item when I click the button in the cell. Is it possible to get it? Right now I have specified the click event of the button in cell in its template.

Here is the code-

var cartButton = new ImageButton() {
ImageHeightRequest = 20,
ImageWidthRequest = 20,
BackgroundColor=Color.White,
Orientation = ImageOrientation.ImageToLeft,
Image = "ic_action_cart"
};
cartButton.HorizontalOptions = LayoutOptions.Center;
//cartButton.WidthRequest = favsButton.HeightRequest = 25;
cartButton.Clicked += (s, e) => {

            //add the item to the selected item list

        };

I want to pass a message to my View Model with the item that I clicked.

Thanks


Viewing all articles
Browse latest Browse all 58056

Trending Articles



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