Problem with WorkingWithListviewNative sample

Good day, I have been using this sample for my listview implementation. It works pretty well and smooth.

see here:
https://github.com/xamarin/xamarin-forms-samples/tree/master/WorkingWithListviewNative/WorkingWithListviewNative

My Question is can i parse a class or List as a cell property?
Here is an example:

`public class NativeCell : ViewCell
{
public NativeCell ()
{
}

    public static readonly BindableProperty testProperty=
        BindableProperty.Create("Test",typeof(List<string>),typeof(NativeCell),"");
    public List<string> test{
        get{ return(List<string>)GetValue (testProperty); }
        set{
            SetValue (testProperty, value);
        }
    }

}`

But When I use this, it occurs an error "The type initializer for 'xxxxx' threw an exception ...". Is it possible to parse a List as a viewcell property instead of string?

Thanks for the help

Posts

  • adamkempadamkemp USInsider, Developer Group Leader mod

    Are you trying to use XAML for this property? What would that even look like?

Sign In or Register to comment.