日期:2014-05-17 浏览次数:21140 次
public class ProductViewModel { private IProductModel _model; public ICollectionView EntityListView { get; private set; } [ImportingConstructor] public ProductViewModel(IProductModel model) { this._model = model; EntityListView = CollectionViewSource.GetDefaultView(_model.GetProducts()); if (EntityListView != null) { EntityListView.CurrentChanged += OnEntityListViewChanged; } } private void OnEntityListViewChanged(object sender, EventArgs e) { // TODO: add your code here } }