示例#1
0
 public VMStudent()
 {
     Student stu1 = new Student();
     stu1.Name = "zhangsan";
     stu1.PhotoBitmapImage1 = "E:\\新建文件夹\\1.png";
     Student stu2 = new Student();
     stu2.Name = "lisi";
     stu2.PhotoBitmapImage1 = "E:\\新建文件夹\\2.png";
     student.Add(stu1);
     student.Add(stu2);
 }
示例#2
0
        public MainWindow()
        {
            ObservableCollection<Student> students = new ObservableCollection<Student>();
            InitializeComponent();
            Student stu1 = new Student();
            stu1.Name = "zhangsan";
            stu1.PhotoBitmapImage1 = "E:\\新建文件夹\\1.png";
            Student stu2 = new Student();
            stu2.Name = "lisi";
            stu2.PhotoBitmapImage1 = "E:\\新建文件夹\\2.png";

            students.Add(stu1);
            students.Add(stu2);
            layoutRoot.DataContext = students;
        }