Esempio n. 1
0
        public void AddActivity()
        {
            var window = new AddActivityWindow();

            Activity newActivity = new Activity();

            window.DataContext = newActivity;

            var result = window.ShowDialog();

            if (result == true)
            {
                SelectedUser.SelectedSemester.ToDoList.Add(newActivity);
            }
        }
Esempio n. 2
0
        public void EditActivity()
        {
            var window = new AddActivityWindow();

            Activity uneditedActivity = new Activity();

            uneditedActivity.Deadline    = ViewModelLocator.StartMenuViewModel.SelectedUser.SelectedSemester.SelectedActivity.Deadline;
            uneditedActivity.Description = ViewModelLocator.StartMenuViewModel.SelectedUser.SelectedSemester.SelectedActivity.Description;
            uneditedActivity.Importance  = ViewModelLocator.StartMenuViewModel.SelectedUser.SelectedSemester.SelectedActivity.Importance;
            uneditedActivity.Type        = ViewModelLocator.StartMenuViewModel.SelectedUser.SelectedSemester.SelectedActivity.Type;

            window.DataContext = ViewModelLocator.StartMenuViewModel.SelectedUser.SelectedSemester.SelectedActivity;

            var result = window.ShowDialog();

            if (result == false)
            {
                ViewModelLocator.StartMenuViewModel.SelectedUser.SelectedSemester.SelectedActivity.Deadline    = uneditedActivity.Deadline;
                ViewModelLocator.StartMenuViewModel.SelectedUser.SelectedSemester.SelectedActivity.Description = uneditedActivity.Description;
                ViewModelLocator.StartMenuViewModel.SelectedUser.SelectedSemester.SelectedActivity.Importance  = uneditedActivity.Importance;
                ViewModelLocator.StartMenuViewModel.SelectedUser.SelectedSemester.SelectedActivity.Type        = uneditedActivity.Type;
            }
        }