I have a SourceList and a ReadOnlyObservableCollection.
public SourceList<T> SourceList { get; set; } = new SourceList<T>();
public ReadOnlyObservableCollection<T> ActiveList;
And bind applies with below code:
SourceList.Connect()
.Filter(criteria, ListFilterPolicy.ClearAndReplace)
.Transform((item, i) => { item.DisplayOrder = i + 1; return item; })
.Bind(out ActiveList)
.Subscribe();
And the list displays in a window :
listItemsControl.ItemsSource = ViewModel.ActiveList;
And I bind IsSelected of any item to IsChecked of a ToggleButton. Everything is good until I add new item to the SourceList. For new added items, the binding is not work.
Thanks for any idea to fix the problem.
If the
criteriathat you're filtering theSourceListon is checking againstIsSelected, then you'll likely have to add an AutoRefresh:By default, a
SourceListwill only push collection changes down the pipeline and won't account for property changes within any given item. By addingAutoRefresh, changes to that property within the source will cause its parent be sent down the pipeline.