Hi I´m trying to bind a List<> to a combobox.
public OfferEdi
Try setting the ItemsSource property with an actual Binding object
XAML Method (recommended):
Programmatic method:
Binding myBinding = new Binding("Name");
myBinding.Source = cusmo.Customer; // data source from your example
customer.DisplayMemberPath = "name";
customer.SelectedValuePath = "customerID";
customer.SetBinding(ComboBox.ItemsSourceProperty, myBinding);
Also, the setter on your Customer property should raise the PropertyChanged event
public ObservableCollection Customer
{
get { return _customer; }
set
{
_customer = value;
RaisePropertyChanged("Customer");
}
}
If the above does not work, try moving the binding portion from the constructor to the OnLoaded override method. When the page loads, it may be resetting your values.