我正在使用 BrightIdeasSoftware 的 objectListView 组件,我想展示一个我创建的列表。所以我有两列:标题,艺术家。接下来,我写了一个歌曲类:
class Song
{
public Song()
{
}
public Song(string title, string artist)
{
this.Title = title;
this.Artist = artist;
}
public string Title
{
get { return title; }
set { title = value; }
}
private string title;
public string Artist
{
get { return artist; }
set { artist = value; }
}
private string artist;
}
并创建了一个列表:
List<Song> songs = new List<Song>();
Song example = new Song("My Immortal", "Evanescence");
songs.Add(example);
最后,我调用了 SetObjects:
objectListView1.SetObjects(songs);
但是......问题是该列表作为一个空列表呈现给我!(我的意思是,没有字符串是在运行时编写的......)
有人可以帮我弄清楚为什么...?