I added LiveDataUpdateMode="AllowDataShaping". However, this caused another issue. The SfList is bound to an ObservableCollection in a .Net library. As soon as TimeToRespond in one of the objects is updated I get this error:
This problem is the .Net library where the ObservableCollection and the model that holds TimeToResponse lives does not have a reference to Xamarin.Forms. So I can't update inside a Device.BeginOnUIThread.
|
protected void OnPropertyChanged<TProperty>(Expression<Func<TProperty>> projection)
{
OnPropertyChanged(new PropertyChangedEventArgs(projection.PropertyName()).PropertyName);
}
protected bool SetProperty<T>(ref T backingStore, T value, [CallerMemberName]string propertyName = "", Action onChanged = null)
{
if (EqualityComparer<T>.Default.Equals(backingStore, value))
return false;
backingStore = value;
#if XForms
Xamarin.Forms.Device.BeginInvokeOnMainThread(() =>
{
onChanged?.Invoke();
OnPropertyChanged(propertyName);
});
#else
onChanged?.Invoke();
OnPropertyChanged(propertyName);
#endif
return true;
} |