我有一个这样的工作 ListView
<ListView Name="passageListView" ItemsSource="{Binding Path=Passages, NotifyOnTargetUpdated=True}" TargetUpdated="PassageListViewTargetUpdated">
哪里Passages是ObservableCollection<>。
现在,我如何在代码中进行相同的绑定?(注意NotifyOnTargetUpdated=True必须设置)
我试图分配 a Binding,passageListView.ItemsSource但这是不允许的,我不能使用SetBinding(),因为passageListView.ItemsSourceis not a DependencyProperty?
有任何想法吗?