title: Is there a way to use a string to reference a variable by name?
body: <p>I am trying to find a better way to populate 100+ variables and notify the UI with OnPropertyChanged() that the variable has changed. Also I do not feel that a DataGrid is a good solution from a presentation perspective.</p>
  <p>Is there a better way or pattern to use?</p>
  <pre><code>private string fred;
  private string wilma;
  public string Fred
  { 
      get { return fred; } 
      set { fred = value; OnPropertyChanged(&quot;Fred&quot;); }
  }
  public string Wilma
  { 
      get { return wilma; } 
      set { wilma = value; OnPropertyChanged(&quot;Wilma&quot;); }
  }
  public void set_value(string name, string val)
  {
     switch (name)
     {
        case &quot;Fred&quot;: Fred = val; break;
        case &quot;Wilma&quot;: Wilma = val; break;
     }
  }
  </code></pre>
  <p>What I would like to do is something like:</p>
  <pre><code>private string fred;
  private string wilma;
  public string GenericMagic(string name)
  { 
      get { return magicSmoke(name); } 
      set { magicSmoke(name) = value; OnPropertyChanged(name); }
  }
  public void set_value(string name, string val)
  {
     GenericMagic(name) = val;
  }
  </code></pre>
  <p>I can imagine it, but does something like this exist?
  I am writing in C#, XAML for a UI.</p>
  <p>Thank you in advance.</p>