This question is locked. New answers and comments are not allowed.
Is it possible to use a collection that can be bound to as a property? Property collection is always of type TrackedList and it does not support data binding.
Ima leave out implementation of INotifyPropertyChanged and some other stuff so the example is as short as possible.
Let's say we have 2 entities, Company and Employee. The only interesting property is that of Company, called Employees and being a collection. We fetch the list of companies and bind combobox to it. We wanna display a list of Employees for currenctly selected Company.
public
ObservableCollection<Company> Companies =
new
ObservableCollection<Company>(Model.Companies);
public
Company SelectedCompany {
get
;
set;
}
<
Combobox
ItemsSource
=
"{Binding Companies}"
SelectedItem="{Binding SelectedCompany}/>
<
Listbox
ItemsSource
=
"{Binding SelectedCompany.Employees"
/>
I haven't been able to implement the Employees property of Company object so it's a collection that can be bound to. So when I add/remove items the bound control is not informed.
Thanks in advance~