Attach to Property's setter
<p>I haven't found similiar post so I'm asking this.<br>
Let's say I defined somewhere an application wide available static Property (I mean it's not local) and in one class I would like to know when this property is being changed. Apart from aop (transparentproxy etc.) which I think doesn't suit me well here (and I can't add that to project anyway), what are the options here?  </p>

<p>One solution I can think of, which is probably a very nasty one, is to use some event that would be executed in the setter and just attach it in the class(es) which needs that.
Something like:  </p>

<pre><code>   public static event EventHandler CurrentNumberChanged= delegate {};
   public static int CurrentNumber
    {
        get
        {
            return currentNumber;
        }
        set
        {
            currentNumber = value;

            CurrentNumberChanged(null, EventArgs.Empty);
        }
    }
</code></pre>

<p>I know it's really unsafe to use such events ( <a href="http://stackoverflow.com/questions/289002/how-to-raise-custom-event-from-a-static-class/289358#289358">read here</a> ). And since I would use it in asp.net makes it even more ugly. Do you have any advices  ?</p>
