public OrganizationChartPositionsVM(OrganizationChartVM organizationChart, AccessType access):base(access)
        {
            UnitOfWork = new SoheilEdmContext();
            CurrentOrganizationChart = organizationChart;
            OrganizationChartDataService = new OrganizationChartDataService(UnitOfWork);
            OrganizationChartDataService.PositionAdded += OnPositionAdded;
            OrganizationChartDataService.PositionRemoved += OnPositionRemoved;
            PositionDataService = new PositionDataService(UnitOfWork);
            OrganizationChartPositionDataService = new OrganizationChartPositionDataService(UnitOfWork);

            RootNode = new OrganizationChartPositionVM(Access, OrganizationChartPositionDataService) { Title = string.Empty, Id = -1, ParentId = -2 };

            var selectedVms = new ObservableCollection<OrganizationChartPositionVM>();
            foreach (var organizationChartPosition in OrganizationChartDataService.GetPositions(organizationChart.Id))
            {
                selectedVms.Add(new OrganizationChartPositionVM(organizationChartPosition, Access, OrganizationChartPositionDataService));
            }

            var allVms = new ObservableCollection<PositionVM>();
            foreach (var position in PositionDataService.GetActives(SoheilEntityType.OrganizationCharts, CurrentOrganizationChart.Id))
            {
                allVms.Add(new PositionVM(position, Access, PositionDataService));
            }
            AllItems = new ListCollectionView(allVms);

            IncludeCommand = new Command(Include, CanInclude);
            ExcludeTreeCommand = new Command(ExcludeTree, CanExcludeTree);


            foreach (OrganizationChartPositionVM item in selectedVms)
            {
                if (item.ParentId == RootNode.Id)
                {
                    RootNode.ChildNodes.Add(item);
                    break;
                }
            }

            CurrentNode = RootNode;
        }
 private void OnOrganizationChartAdded(object sender, ModelAddedEventArgs<OrganizationChart> e)
 {
     var newOrganizationChartVm = new OrganizationChartVM(e.NewModel, Access, OrganizationChartDataService);
     Items.AddNewItem(newOrganizationChartVm);
     Items.CommitNew();
     CurrentContent = newOrganizationChartVm;
     CurrentContent.IsSelected = true;
 }