private void Btn_CreateUnit_Click(object sender, RoutedEventArgs e)
 {
     EditUnitWindow cuw = new EditUnitWindow(AppMgr);
     cuw.ShowDialog();
     if (cuw.DialogResult == true)
     {
         Unit parent = HospView.SelectedUnit != null ? HospView.SelectedUnit.Reference : null;
         AppMgr.HospitalManagement.AddUnit(cuw.EditUnitView.Unit, parent);
         HospView.UpdateHierarchyList();
     }
 }
        private void TreeView_Hierarchy_MouseDoubleClick(object sender, MouseButtonEventArgs e)
        {
            if (HospView.SelectedUnit != null)
            {
                Unit unit = HospView.SelectedUnit.Reference;
                Unit unitClone = (Unit)unit.Clone();
                EditUnitWindow editUnitWindow = new EditUnitWindow(unitClone, AppMgr);
                editUnitWindow.Title = "Szervezeti egység módosítása";
                editUnitWindow.ShowDialog();
                if (editUnitWindow.DialogResult == true)
                {
                    unitClone = editUnitWindow.EditUnitView.Unit;
                    AppMgr.HospitalManagement.UpdateUnit(unitClone, unit);
                }

                HospView.UpdateHierarchyList();
                var selection = HospView.SelectedUnit;
                HospView.SelectedUnit = null;
                HospView.SelectedUnit = selection;
            }
        }