29 lines
914 B
C#
29 lines
914 B
C#
|
using MVVMComboBoxSample.Model;
|
|||
|
using System;
|
|||
|
using System.Collections.Generic;
|
|||
|
using System.Collections.ObjectModel;
|
|||
|
using System.Linq;
|
|||
|
using System.Text;
|
|||
|
using System.Threading.Tasks;
|
|||
|
|
|||
|
namespace MVVMComboBoxSample.ViewModel
|
|||
|
{
|
|||
|
internal class StudentViewModel
|
|||
|
{
|
|||
|
public ObservableCollection<Student> Students { get; set; }
|
|||
|
|
|||
|
public Student SelectedStudent { get; set; }
|
|||
|
|
|||
|
public StudentViewModel()
|
|||
|
{
|
|||
|
this.Students = new ObservableCollection<Student>()
|
|||
|
{
|
|||
|
new Student() { ID = Guid.NewGuid().ToString(), Name = "Joe", Age = 20 },
|
|||
|
new Student() { ID = Guid.NewGuid().ToString(), Name = "Jane", Age = 21 },
|
|||
|
new Student() { ID = Guid.NewGuid().ToString(), Name = "Rick", Age = 22 },
|
|||
|
new Student() { ID = Guid.NewGuid().ToString(), Name = "Paul", Age = 23 },
|
|||
|
};
|
|||
|
}
|
|||
|
}
|
|||
|
}
|