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