I have a listview and all the listview item contain a switch at the right end like below picture.
When I select an item the switch fires the Toggled event. My codes are adding below:
Xaml:
<Switch
Toggled="OnToggledEvent"
HorizontalOptions="EndAndExpand"
VerticalOptions="CenterAndExpand"/>
Xaml.cs:
void OnToggledEvent(object sender, ToggledEventArgs args)
{
//How I can access the userId of the selected item
}
Model class:
public class DirectoryResponse
{
public List<UserProfileHBList> userProfileHBList { get; set; }
}
public class UserProfileHBList
{
public UserProfileTO userProfileTO { get; set; }
}
public class UserProfileTO
{
public string userId { get; set; }
public string firstName { get; set; }
public string email { get; set; }
public string lastName { get; set; }
}
I need the userId of the selected item, how I can access that.
Thanks in advance