title: How to call a method whenever an entry of an array-type property is changed?
body: <p>I have a property of type <code>double[]</code> with a public get and set accessor. I would like to call some input check whenever one element of the array is changed.</p>
  <p>I have tried the following:</p>
  <pre><code>private double[] myArray;
  
  public double[] MyArray
  {
      get { return myArray; }
      set 
      {
          CheckInput(value);
          myArray = value;
      }
  }
  </code></pre>
  <p>However, when I run for example <code>classInstance.MyArray[3] = 5;</code> the <code>CheckInput</code> method is not called (which makes sense, as the array is only <em>modified</em> but not re-set to a new object).</p>