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

Why does the `ItemSelected` method execute twice when touching a ListView item?

$
0
0

My ListView has the following handler attached.

((ListView)MediaList).ItemSelected += (sender, args) => TriggerMedia((MediaViewModel)args.SelectedItem);

And when TriggerMedia() is run, it runs twice. The first time, it has a hydrated MediaViewModel passed in, and the second time it's null (because I set it to null within the TriggerMedia method).

I can fix it simply by checking for null. But I wonder why it runs twice?


Viewing all articles
Browse latest Browse all 58056

Trending Articles



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