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

How to service Button.Clicked event in a custom ListView.ItemTemplate

$
0
0

If using XAML, it is very easy as all the events are defined in the code behind where all objects of the page are accissible. But I am building UI in the code and servicing a button click event with in a custom ViewCell for ItemTemplate. (I have resorted to coding UI as XAML in a PCL project was not very quick and easy. I don't know if the recent updates have made the XAML in PCL as easy as in the Shared projects.)

Since the custom ItemTemplate is defined as a separate class, I am not able to access the objects and fields in the page that contains the ListView. How do I go about it?

First I have to get the ListView.SelectedItem. Then I want to access some public fields.

Can anyone show me either documentation or an example code?


Viewing all articles
Browse latest Browse all 91519

Trending Articles



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