Data binding 双向数据绑定不更新引用

Data binding 双向数据绑定不更新引用,data-binding,silverlight-4.0,Data Binding,Silverlight 4.0,我有一个自定义用户控件,我在这里称之为Tree,它定义了IEnumerable集合的DependecProperty public static readonly DependencyProperty ItemsSourceProperty = DependencyProperty.RegisterAttached("ItemsSource", typeof(IEnumerable), typeof(RadTreeView)); ItemsSource = ItemsSource.Cast&l

我有一个自定义用户控件,我在这里称之为Tree,它定义了IEnumerable集合的DependecProperty

public static readonly DependencyProperty ItemsSourceProperty = DependencyProperty.RegisterAttached("ItemsSource", typeof(IEnumerable), typeof(RadTreeView));
ItemsSource = ItemsSource.Cast<object>().OrderBy(x => TypeHelper.GetPropertyValue(x, SortField.Path), SortField.GetComparer()).ToList();
我有一个创建集合新实例的排序例程

public static readonly DependencyProperty ItemsSourceProperty = DependencyProperty.RegisterAttached("ItemsSource", typeof(IEnumerable), typeof(RadTreeView));
ItemsSource = ItemsSource.Cast<object>().OrderBy(x => TypeHelper.GetPropertyValue(x, SortField.Path), SortField.GetComparer()).ToList();
我还尝试在对集合排序后显式更新源绑定

GetBindingExpression(ItemsSourceProperty).UpdateSource();
当源DataContext引用被依赖项更改时,如何更新该引用?

使用。这将是一个代理源,位于实际项目和绑定到树的源之间