Beispiel #1
0
 private void InsertVacationFunctionalGroup()
 {
     var g = new VacationService.VacationFunctionalGroup()
     {
         Name = "Новая функциональная группа",
     };
     var gvm = VacationFunctionalGroupViewModel.CreateEdited(g, this);
     gvm.PropertyChanged += (_, e) => 
     {
         var checkList = new[] { nameof(gvm.IsDeleted), nameof(gvm.IsEditMode) };
         if (checkList.Contains(e.PropertyName) && gvm.Group.Id == 0)
         {
             if (vacationFunctionalGroups.Contains(gvm))
                 vacationFunctionalGroups.Remove(gvm);
         }
         if (e.PropertyName == nameof(gvm.IsChecked))
         {
             EmployeeVacationsCollectionView.Refresh();
         }
     };
     vacationFunctionalGroups.Add(gvm);
 }
 private void StartEdit()
 {
     var grp = new VacationService.VacationFunctionalGroup();
     grp.CopyObjectFrom(Group);
     GroupForEdit = grp;
 }