If I have a field, I can generate the corresponding property by right-clicking on the field -> Refactor -> Encapsulate Field.
Is there a way to accept the opposite?
I have properties like
public int Foo { get; set; }
I want to create private fields and change getter and setter to use this field. Then I can implement INotifyPropertyChanged and change the setter to fire the PropertyChanged event when the property value changes.
therefore he becomes
eg.
private int _foo;
public int Foo
{
get { return _foo;}
set
{
if (value != _foo)
{
_foo = value;
NotifyPropertyChanged("Foo");
}
}
}
David source
share