在WPF XAML中我有
<CollectionViewSource
x:Key="aViewSource"
d:DesignSource="{d:DesignInstance my1:TableA, CreateList=True}" />
<CollectionViewSource
x:Key="anotherViewSource"
Source="{Binding Path=ANOTHER, Source={StaticResource aViewSource}}" />
在xaml.cs中我有
var aViewSource = (CollectionViewSource)this.FindResource("aViewSource");
var tableA = new ObservableCollection<TableA>(
this.entities.TableA
.Where(predicate)
.Take(10)
.ToList());
tableA.CollectionChanged += this.NotifyCollectionChangedEventHandler;
fibrasViewSource.Source = tableA;
如何观察anotherViewSource
?
答案 0 :(得分:0)
我完全放弃了ViewSource,因为我没有看到使用它的优势。