title: How to replace an element in KeyValuePair<> List<>
body: <p>Okay, I have this KeyValuePair list:</p>
  
  <pre><code>public ObservableCollection&lt;KeyValuePair&lt;string, float&gt;&gt; values { get; set; }
  </code></pre>
  
  <p>Now I want to know if there is already this element. I tried this with:</p>
  
  <pre><code>bool conaintsValue = values.Contains(value);
  </code></pre>
  
  <p>But how do I replace this element now?
  This is what I tried:</p>
  
  <pre><code>if(values.Contains(value))
  {
      int i = values.IndexOf(value);
      values[i] = value;
  }
  </code></pre>
  
  <p>But this does not work.</p>
  
  <p>EDIT:
  I add a value like this! Values = List!</p>
  
  <pre><code>KeyValuePair&lt;string, float&gt; value = new KeyValuePair&lt;string, float&gt;(chartKey, chartValue);
  </code></pre>
  
  <p>This is my list:</p>
  
  <pre><code>public ObservableCollection&lt;KeyValuePair&lt;string, float&gt;&gt; values { get; set; }
  </code></pre>