I have several comboboxes which are initialiced with a default text which will be replaced later on by textes out of a text-file to support different languages. I tried different ways to change the text but none of them worked out:
Initialization:
myCombobox.itemSource = new ObservableCollection(Of String){"FirstItem", "SecoundItem"})
First Way:
myCombobox.Items(i) = GetString(myCombobox.Items(i))
Secound Way:
Dim comboboxStr = myCombobox.Items(i)
myCombobox.Items.RemoveAt(i)
myCombobox.Items.Add(GetString(i))
Both ways throw an InvalidOperationException with the hint to try "ItemsControl.ItemsSource" instead of "ItemsSource"
Is there maybe another way to change the items or what why is this exception occurring?