是否需要注册ObservableCollection PropertyChangedEventHandler?

时间:2015-08-13 15:35:57

标签: wpf observablecollection

我有这个ObservableCollection<MyData>来保存我的对象并实现INotifyPropertyChanged interface

请注意此属性更改:

private int _files;

public int Files
{
    get { return _files; }
    set
    {
        _files= value;
        NotifyPropertyChange("Files");
    }
}

public virtual void NotifyPropertyChange(string propertyName)
{
    var handler = PropertyChanged;
    if (handler != null)
        handler(this, new PropertyChangedEventArgs(propertyName));
}

所以在我的对象完成它的工作后,我需要UnregisteredPropertyChangedEventHandler

0 个答案:

没有答案