2012-02-24 58 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,因爲我沒有看到使用它的優點。