Esempio n. 1
0
        public MainVM()
        {
            model = new Model();
            PageManager.SetModel(model);
            CurrentPage = PageManager.GetPageByType(PageType.StudentList);
            PageManager.CurrentPageChanged += PageManager_CurrentPageChanged;

            OpenGroupList   = new MvvmCommand(() => PageManager.ChangePageTo(PageType.GroupList), () => true);
            OpenStudentList = new MvvmCommand(() => PageManager.ChangePageTo(PageType.StudentList), () => true);
        }
Esempio n. 2
0
        public void SetModel(Model model)
        {
            this.model = model;

            BackToList = new MvvmCommand(
                () => { PageManager.ChangePageTo(PageType.StudentList); model.NoSaveStudent(); },
                () => true);

            SaveStudent = new MvvmCommand(
                () => { PageManager.ChangePageTo(PageType.StudentList); model.SaveStudent(); },
                () => model.CanSave(SelectedStudent));

            model.SelectedStudentChanged += Model_SelectedStudentChanged;
        }