Lets say I have an class with two properties of type string
- Prop1
- Prop2
And there are the following restrictions
- Prop1 can not be equal to "Test1" if Prop2 value is "Test2"
- Prop2 can not be equal to "Test22" if Prop1 value is "Test11"
- Set Prop1= "Test111" if Prop2="Test222"
What is the best way to define the properties whose value is dependent on one another and also changes made in one property should trigger setter property of the other?
homework
tag - if it were still around? @Paul> I think you will need some "ifs" and then throw exceptions (or do nothing) in case of trying to set "Test1" or "Test22". - Laoujin