ObservableCollectionは次のように定義されています
public ObservableCollection<KeyValuePair<string, double>> comboBoxSelections
{
get;
set;
}
後で私のコードで、コレクションを繰り返し、一部の値のみを変更する必要がありますが、同じキーを保持します。私は以下を試しました
for (int i = 0; i < comboBoxSelections.Count ; i++)
{
comboBoxSelections[i].Value = SomeDoubleValue;
}
しかし、これはエラーになりますProperty or indexer 'System.Collections.Generic.KeyValuePair<string,double>.Value' cannot be assigned to -- it is read only
誰かが私がエラーを受け取る理由と更新を許可する方法を説明できますObservableCollection
か?