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

Manually Update ListView binding

$
0
0

I have an ObservableCollection of messages with a timestamp field bound to a Listview. I am using an extension method to display a string based on how old the message is, i.e. "5 minutes ago"

What's the best way to keep this field updated over time? The underlying data does not change, but I need to update the display periodically to let the user know how old the message is. I am currently using a timer in the ViewCell and calling
timeLabel.SetValue(Label.TextProperty, created.ToRelativeString());
every 10 seconds.

Wondering if there is a way to force an update on the binding from the page with one timer rather than having a timer in each of the cells.

Thanks!


Viewing all articles
Browse latest Browse all 77050

Trending Articles



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