public void EditClassWithDetails()
        {
            var viewModel = AddClassViewModel.CreateForEdit(MainScreenViewModel, ViewItemsGroupClass.Class);

            viewModel.IncludesEditingDetails = true;
            MainScreenViewModel.ShowPopup(viewModel);
        }
        public static AddClassViewModel CreateForEdit(BaseViewModel parent, ViewItemClass classToEdit)
        {
            var answer = new AddClassViewModel(parent)
            {
                State       = OperationState.Editing,
                ClassToEdit = classToEdit,
                Name        = classToEdit.Name,
                Color       = classToEdit.Color,
                Details     = classToEdit.Details
            };

            if (!PowerPlannerSending.DateValues.IsUnassigned(classToEdit.StartDate))
            {
                answer.StartDate = classToEdit.StartDate;
            }

            if (!PowerPlannerSending.DateValues.IsUnassigned(classToEdit.EndDate))
            {
                answer.EndDate = classToEdit.EndDate;
            }

            // If there's a custom start/end date, we check the partial semester box
            if (answer.StartDate != null || answer.EndDate != null)
            {
                answer.IsPartialSemesterClass = true;
            }

            return(answer);
        }
 public void EditClass()
 {
     MainScreenViewModel.ShowPopup(AddClassViewModel.CreateForEdit(MainScreenViewModel, ViewItemsGroupClass.Class));
 }