// For AddCommand
        public override void Add()
        {
            // 显示用户控
            var addOrEditUserControl = new AddOrEditCourseUserControl();
            var addOrEditViewModel   = (addOrEditUserControl.DataContext as AddOrEditCourseViewModel);

            addOrEditViewModel.CourseViewModel  = new CourseViewModel();
            addOrEditViewModel.CourseViewModels = CourseViewModels;
            addOrEditViewModel.CourseViewModels.Add(addOrEditViewModel.CourseViewModel);
            addOrEditViewModel.Action = ViewModelAction.Add;

            var oldCurrentViewModel = CurrentCourseViewModel;

            CurrentCourseViewModel = addOrEditViewModel.CourseViewModel;

            // 显示侧边框
            BundleActivator.MainWindowService.ShowSidebar(addOrEditUserControl, 300, "添加课程");

            addOrEditViewModel.PropertyChanged += (sender, e) =>
            {
                if (e.PropertyName.Equals(AddOrEditCourseViewModel.ResultPropertyName))
                {
                    if (addOrEditViewModel.Result != true)
                    {
                        CurrentCourseViewModel = oldCurrentViewModel;
                    }
                    else
                    {
                        Message = "添加课程成功";
                    }
                }
            };
        }
        // For EditCommand
        public override void Edit()
        {
            if (CurrentCourseViewModel == null)
            {
                ModernDialog.ShowMessage("请选择一个课程。", "操作警告", MessageBoxButton.OK);
                return;
            }
            var addOrEditUserControl = new AddOrEditCourseUserControl();
            var addOrEditViewModel   = (addOrEditUserControl.DataContext as AddOrEditCourseViewModel);

            addOrEditViewModel.CourseViewModel  = CurrentCourseViewModel;
            addOrEditViewModel.CourseViewModels = CourseViewModels;
            addOrEditViewModel.Action           = ViewModelAction.Edit;

            // 显示侧边框
            BundleActivator.MainWindowService.ShowSidebar(addOrEditUserControl, 300, "编辑课程");

            addOrEditViewModel.PropertyChanged += (sender, e) =>
            {
                if (e.PropertyName.Equals(AddOrEditCourseViewModel.ResultPropertyName))
                {
                    if (addOrEditViewModel.Result == true)
                    {
                        Message = "编辑课程成功";
                    }
                }
            };
        }