Hi Sonal,
We suggest you create the bindable property as mentioned below,
TapView
|
public static readonly BindableProperty ProductListProperty = BindableProperty.Create(
nameof(ProductList), typeof(ObservableCollection<Product>), typeof(TapView), null,
BindingMode.Default, null, (bindable, oldValue, newValue) =>
{
((TapView)bindable).ItemsSource = (ObservableCollection<Product>)newValue;
});
public ObservableCollection<Product> ProductList
{
get { return (ObservableCollection<Product>)GetValue(ProductListProperty); }
set { SetValue(ProductListProperty, value); }
} |
You can also refer to the following documentation to create bindable property in Xamarin.Forms,
Also, you need to create the property as the type of the model collection (i.e., ObservableCollection<Products>), or else binding error will be thrown.
We have modified the sample to achieve your requirement and attached in the following link,
Please let us know if you need further assistance.
Lakshmi Natarajan