문제

I created a class that inherits from ObservableCollection<T> and wanted to use it instead of IList<T>. When I modified the generator to generate ObservableCollection<T> or MyCollectionClass<T>(inherits ObservableCollection<T>) it gives this error:

'MyCollectionClass' does not contain a definition for 'Customer' and no extension method 'Customer' accepting a first argument of type 'MyCollectionClass' could be found (are you missing a using directive or an assembly reference?)

Does anyone faced this problem before? Thanks for the help!

도움이 되었습니까?

해결책 3

I am answering to my own question: I created my own collection class and made it inherit from TrackedBindingList and implemented INotifyCollectionChanged. That took care of the issue.

다른 팁

You can use TrackedBindingList, however when you do that you have to provide data type of the collection items.

companies.HasAssociation<Customer>(c => c.Customer)
    .WithOpposite(c => c.Company)
    .HasConstraint((c,​cc) => c.ID == cc.CustomerID);

You could troubleshoot the issue on your side using the information listed here and here.

라이센스 : CC-BY-SA ~와 함께 속성
제휴하지 않습니다 StackOverflow
scroll top