I have a list of nullable integer and it look like a 1 to many relation
id1 can have an id2 and id3
id2 can have id4
if the value of id1 change, id2 and id3 must be set to null and it mean id4 must be set to null
In that example, I only use 4 variables so that easy to manage.
I got, for now, at least 15 variables to manage.
The way I’m thinking of doing it for now is within the “set” property checking if the value change and if it’s the case, setting the child value to null. This is going to be a nightmare later on if the relation change and a nightmare for maintenance.
Is there an easier/better way than what I just said?
You might consider using INotifyPropertyChanged and add handlers for when values change. That way, you can put all of your logic in one place.