I have a class which contains 5 properties.
If any value is assingned to any of these fields, an another value (for example IsDIrty) would change to true.
public class Class1
{
bool IsDIrty {get;set;}
string Prop1 {get;set;}
string Prop2 {get;set;}
string Prop3 {get;set;}
string Prop4 {get;set;}
string Prop5 {get;set;}
}
To do this you can’t really use automatic getter & setters, and you need to set IsDirty in each setter.
I generally have a “setProperty” generic method that takes a ref parameter, the property name and the new value.
I call this in the setter, allows a single point where I can set isDirty and raise Change notification events e.g.