コード例 #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);
        }