title: How to change all values in a Dictionary<string, bool>?
body: <p>So I have a <code>Dictionary&lt;string, bool&gt;</code> and all I want to do is iterate over it and set all values to false in the dictionary. What is the easiest way to do that?</p>
  
  <p>I tried this:</p>
  
  <pre><code>foreach (string key in parameterDictionary.Keys)
      parameterDictionary[key] = false;
  </code></pre>
  
  <p>However I get the error: "Collection was modified; enumeration operation may not execute."</p>
  
  <p>Is there a better way to do this?</p>