Error when binding WPF combobox ItemsSource to an Array of Strings
问题 I could not set a combobox's ItemsSource to an Array. I have tried setting the DataContext to the class where the Array is found, and then setting the bindings in XAML class Car { public string[] makes; } ... public MainWindow() { Car _Car = new Car(); _Car.makes = new string[] { "Toyota", "Mitsubishi", "Audi", "BMW" }; this.DataContext = _Car; } and then in XAML <ComboBox Name="cars" Grid.Column="0" Grid.Row="0" Margin="5" ItemsSource="{Binding Path=makes}"/> It doesn't seem to do anything.