Let’s say I have three classes:
BaseClassA,BaseClassB,ClassC.
The flow is the following:
ClassC : BaseClassB: BaseClassA.
ClassC is a ViewModel and I bind some Property (let’s name it SomeProperty) which is defined in the BaseClassA level.
When I write in the view ItemsSource = {Binding SomeProperty} the binding fails.
The binding works perfectly when SomeProperty is defined at the BaseClassB level or if I define it at the ClassC level e.g. SomeProperty {get {return base.SomeProperty}}
Is such a behaviour by design or am I missing something?
[upd]
The property is of DomainCollectionView type.
I update the property in the OnLoadEntitiesCompleted method of the BaseClassA instance.
Previously I had only ClassC and BaseClassA objects and everything worked perfectly indeed.
After introducing the mid-tier BaseClassB object the binding stopped to work.
Is it something specific to DomainCollectionView
I can’t share the code so I’ll post the meaningful parts. If it’s not enough I’m willing to share more:
public abstract BaseClassA
{
protected DomainCollectionView CollectionView {get;}
}
public abstract BaseClassB : BaseClassA
public ClassC : BaseClassB
Assuming your example is accurate: Your property is not public so binding fails.
Nothing at all to do with your inheritance.
Change it to:
and try again.