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