I\'m trying to add a predefined ComboBoxItem into my ComboBox which already has a ItemsSource property set. example:
(Select item)
Item 1
Item 2
Item 3
If you want to dynamically change the contents of items source, use ObservableCollection instead, so you will have access to Add() method.
private ObservableCollection myStrings;
public MyClass()
{
myStrings = new ObservableCollection();
myControl.ItemsSource = myStrings;
}
private void AddNewItem(string item)
{
myStrings.Add(item);
}