title: How to trigger event when a variable's value is changed?
body: <p>I'm currently creating an application in C# using Visual Studio. I want to create some code so that when a variable has a value of 1 then a certain piece of code is carried out.
  I know that I can use an if statement but the problem is that the value will be changed in an asynchronous process so technically the if statement could be ignored before the value has changed.</p>
  
  <p>Is it possible to create an event handler so that when the variable value changes an event is triggered? If so, how can I do this?</p>
  
  <p>It is completely possible that I could have misunderstood how an if statement works! Any help would be much appreciated.</p>