The Syncfusion® native Blazor components library offers 70+ UI and Data Viz web controls that are responsive and lightweight for building modern web apps.
.NET PDF framework is a high-performance and comprehensive library used to create, read, merge, split, secure, edit, view, and review PDF files in C#/VB.NET.
I'm having a situation where the onBindingContextChanged method is not called in a ViewCell used in the Syncfusion sfListView through a DataTemplateSelector.
When I use the regular Xamarin.Forms ListView (commented in code below) the OnBindingContextChanged method is called and everything works fine.
Page with sfListView (binding is done by means of a ViewModel):
_generalTotalDataTemplate = new DataTemplate(typeof(TotalTileViewCell)); _detailTotalDataTemplate = new DataTemplate(typeof(AccordionDetailTotalViewCell));
if (item is GeneralTotal) return _generalTotalDataTemplate;
if (item is DetailTotal) return _detailTotalDataTemplate;
}
}
The ViewCell itself is just a regular Xamarin.Forms ViewCell with some stacklayout and labels in it. I need the OnBindingContextChanged method because these viewcell are dynamic and I have to take actions depending on the values of the binded object.
DBDinesh Babu Yadav Syncfusion Team October 2, 2017 05:43 AM UTC
Hi Peter,
Thank you for using Syncfusion Products.
In Xamarin Forms ListView, ViewCell has been internally handled to raise the OnBindingContextChanged event and override method whenever the binding context of item is changed. But in SfListView, we have updated the binding context of the ListViewItem only and it raises the View’s bindingcontext event if loaded in ViewCellas like below code example in which you can dynamically modify the data for the item.