Answer the question
In order to leave comments, you need to log in
How to override subscription to PropertyChanged?
There is a class that implements INotifyPropertyChanged, hence there is an event in the class
public event PropertyChangedEventHandler PropertyChanged
public event PropertyChangedEventHandler PropertyChanged
{
add
{
WeakEventManager<BaseNotifyPropertyChanged, EventArgs>.AddHandler(this, "PropertyChanged", (EventHandler<EventArgs>)value);
//либо же
PropertyChangedEventManager.AddHandler(this, value, "IsDirty");
}
remove
{
//аналогичный код
}
}
Answer the question
In order to leave comments, you need to log in
try to do like this,
I didn’t understand much about what needs to be done, but I believed you and that’s it.
public event PropertyChangedEventHandler PropertyChanged
{
add
{
WeakEventManager<INotifyPropertyChanged, PropertyChangedEventArgs>.AddHandler(this, "PropertyChanged", new EventHandler<PropertyChangedEventArgs>(value));
//либо же
PropertyChangedEventManager.AddHandler(this, new EventHandler<PropertyChangedEventArgs>(value), "IsDirty");
}
remove
{
WeakEventManager<INotifyPropertyChanged, PropertyChangedEventArgs>.RemoveHandler(this, "PropertyChanged", new EventHandler<PropertyChangedEventArgs>(value));
//аналогичный код
PropertyChangedEventManager.RemoveHandler(this, new EventHandler<PropertyChangedEventArgs>(value), "IsDirty");
}
}
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question