2012-02-24 53 views
0

在WPF XAML我如何观察相关的ViewSource?

<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

我放弃了ViewSource,因为我没有看到使用它的优点。