예제 #1
0
 /// <summary>
 /// to == null: toTop
 /// </summary>
 private void AddDpvm(DepartmentViewModel from, DepartmentViewModel to)
 {
     if (to == null)
     {
         TopDepartmentVMs.Add(from);
     }
     else
     {
         to.AddChildDepartment(from);
     }
 }
예제 #2
0
        private void RemoveDepartment()
        {
            //move children to Top
            foreach (var childDpvm in SelectedDp.ChildrenDpvms)
            {
                childDpvm.ParentDpvm = null;
                TopDepartmentVMs.Add(childDpvm);
            }
            SelectedDp.ChildrenDpvms.Clear();

            //remove
            RemoveDpvm(SelectedDp);
            Model.RemoveWithEntity(SelectedDp.Model);
        }