为对象集合引发事件

时间:2012-12-06 07:35:15

标签: c#

如果修改了Collection,如何引发事件。类型是对象:

public object Source
{
   get;
   set;
}

我想在OnPropertyChanged中为Source引发NotifyCollectionChangedEvent

1 个答案:

答案 0 :(得分:1)

private object _Source;
public object Source
{
    get{
        return this._Source;
    }
    set{
        this._Source = value;
        NotifyPropertyChanged("Source");
    }
}