コード例 #1
0
 public AddWindowVM(AddWindow w, MainVM vm)
 {
     Mvm        = vm;
     window     = w;
     AddCommand = new AddCommand(this);
     Db         = new StudentDb();
 }
コード例 #2
0
        public MainVM(MainWindow mw)
        {
            MainWindow       = mw;
            SortCommand      = new SortCommand(this);
            DeleteCommand    = new DeleteCommand(this);
            AddWindowCommand = new AddWindowCommand(this);
            db = new StudentDb();
            var stud = db.students.ToList();

            StudentsList = new List <Student>();
            foreach (var s in stud)
            {
                StudentsList.Add(s);
            }
            //Student = new Student { LName = "Фадеев", FName = "Павел", SName = "Сергеевич", Group = "НПИбд", Stip = 0 };
            //StudentsList.Add(new Student { LName = "Фадеев", FName = "Павел", SName = "Сергеевич", Group = "НПИбд", Stip = 0 });
            //StudentsList.Add(new Student { LName = "Аносов", FName = "Роман", SName = "Сергеевич", Group = "НПИбд", Stip = 5000 });
            //StudentsList.Add(new Student { LName = "Удалов", FName = "Тимофей", SName = "Дмитриевич", Group = "НПИбд", Stip = 1000 });
            //StudentsList.Add(new Student { LName = "Новосельцев", FName = "Максим", SName = "Сергеевич", Group = "НПИбд", Stip = 2000 });
        }