I’m developing a program in C# and need a mutable variable that is available to all classes in my program.
For example, I want to set it to a default value, say false, when the program starts, then be able to change it to true later when an action occurs. The true value then needs to be conveyed when other classes read it.
How can this be achieved?
How about a static?:
In your code:
No initialisation necessary because booleans always initialise to
false.