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