Files
WPF_Practice/PacticeSolution/MVVMComboBoxSample/ViewModel/StudentViewModel.cs

29 lines
914 B
C#
Raw Normal View History

2023-06-27 17:41:22 +09:00
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 },
};
}
}
}