Currently, a dirty property is also set to create the setter . I need to do something like this:
private bool _isDirty;
private int _lives;
public int Lives{
get { return _lives; }
set {
if (_lives != value){
_lives = value;
_isDirty = true;
}
}
}
This is not a huge pain to write, but it is a very vertically spacious and repeating piece of code for writing, if I use quite a lot of this template in my project.
Is there an abbreviated or alternative, shorter syntax for this in C #?
What I'm specifically trying to accomplish is that some variable changes should trigger a dirty flag, which, at the stage of code visualization, can be used to update rendering properties. p>