我做的一切对吗?
public List<string> combolist { get; set; }
...
this.combolist = new List<string>();
MySqlCommand status_db = new MySqlCommand("select name_ru from request_status", conn);
MySqlDataReader combodata = status_db.ExecuteReader();
while (combodata.Read())
{
combolist.Add(combodata.GetString(0));
}
this.DataContext = this;
在xml中:
<ComboBox ItemsSource="{Binding Path=combolist}"...
但是项目组合框是空的,怎么了?