well, i'm trying to make a custom view which is like user thumbnail view. the view(ViewCell?) displays UserModel(my custom model)'s thumbnail + username.
this is the code in UploaderCell.xaml.cs
public static readonly BindableProperty UploaderProperty =
BindableProperty.Create(
propertyName: "Uploader",
returnType: typeof(UserModel),
declaringType: typeof(UploaderCell)
);
public UserModel Uploader
{
get
{ return GetValue(UploaderProperty) as UserModel; }
set
{ SetValue(UploaderProperty, value); }
}
and this is used like <UploaderCell Uploader="{Binding post.uploader}"/>
in some where else.
and the error i get is System.InvalidCastException Class
it's not my mistake about actually passing the wrong data.
so my question is, is it impossible to make BindableProperties with non basic types(string, int ,ect..)?