WPF Databinding combobox to a list<string>

Viewed 57434

I am having a difficult time trying to bind my property which is of type List to my combobox through XAML.

public List<string> MyProperty  { get; set; }

The following XAML binding does not work:

<ComboBox Name="cboDomainNames" ItemsSource="{Binding Path=MyProperty}"/> 

But the following assignment:

cboDomainNames.ItemsSource = MyProperty;

works perfectly. What i am missing here?

3 Answers
Related