nicolo-ottaviani / Xamarin.BindableProperty.Fody

An assembly weaver, based on Fody, that automatically generates bindable properties on a Xamarin Forms project.
MIT License
9 stars 3 forks source link

Fails when the type of the property to be bound is a generic type #3

Closed SimonRev closed 5 years ago

SimonRev commented 6 years ago

Something doesn't work when the type in question is a generic type. `

public class NonSelectableListView : ContentView
{
    // Note:  We are using IEnumerable<object> instead of IEnumerable for the ItemSource type to permit certain LINQ expressions more easily.  We could consider going up to an 
    // IList which might be even better and have a Count property that doesn't require enumerating the list to calculate.
    public static readonly BindableProperty ItemsSourceProperty = BindableProperty.Create(nameof(ItemsSource), typeof(IEnumerable<object>),
        typeof(NonSelectableListView), propertyChanged: OnItemsSourceChanged);

    public IEnumerable<object> ItemsSource
    {
        get => (IEnumerable<object>)GetValue(ItemsSourceProperty);
        set => SetValue(ItemsSourceProperty, value);
    }

`

nicolo-ottaviani commented 5 years ago

Thanks for the feedback. Now i have some spare time, i am investigating on the issue.

nicolo-ottaviani commented 5 years ago

Now this should be fixed with version 0.1.6