public class Post
{
public String Title { get; set; }
public String Author { get; set; }
public DateTime PublishedDate { get; set; }
}
private void button1_Click(object sender, RoutedEventArgs e)
{
// this.dataGrid1.ItemsSource = Customer.GetSampleCustomerList();
List<Post> posts = new List<Post>()
{
new Post {Title ="开发第一个程序",Author ="nw",PublishedDate=DateTime.Now},
new Post {Title ="控件模型",Author ="nw",PublishedDate=DateTime.Now},
new Post {Title ="界面布局",Author ="nw",PublishedDate=DateTime.Now}
};
this.listBox1.ItemsSource = posts; // Customer.GetSampleCustomerList();
}