private void setItems()
        {
            if (PageCollection.LogicRoot.BoolValue)
            {
                HeaderIsEditable = false;
                Header = Resources.Strings.Solution_Pad_PageCollectionItem_LogicRootName;
            }
            else
            {
                HeaderIsEditable = true;
                Header = PageCollection.PageCollectionName.ToString();
            }

            var newCollection = new ObservableCollection<INodeWrapper>();
            foreach (var nPageCollection in PageCollection.NodePageCollectionChildren.Items)
            {
                var pageCollection = FindItemByNodeId(nPageCollection.ID) as PageCollectionItem;
                if (pageCollection == null)
                {
                    pageCollection = new PageCollectionItem(this, nPageCollection);
                    HookupHandlers(pageCollection);
                }
                newCollection.Add(pageCollection);
            }
            foreach (var nPage in PageCollection.NodePageChildren.Items)
            {
                var page = FindItemByNodeId(nPage.ID) as PageItem;
                if (page == null)
                {
                    page = new PageItem(this, nPage);
                    HookupHandlers(page);
                }
                newCollection.Add(page);
            }
            Items = newCollection;
        }
        public void SetItems()
        {
            var newCollection = new ObservableCollection<INodeWrapper>();

            // Logic
            var logic = new PageCollectionItem(this, RuntimeApplication.Logic);
            logic.Edited += new EditedHandler(Logic_Edited);
            newCollection.Add(logic);

            // DeviceConfiguration
            var dc = new DeviceConfigurationItem(this, RuntimeApplication.DeviceConfiguration);
            dc.Edited += new EditedHandler(DeviceConfiguration_Edited);
            newCollection.Add(dc);

            Items = newCollection;
        }
 void HookupHandlers(PageCollectionItem pageCollection)
 {
     pageCollection.Parent = this;
     pageCollection.Edited += new EditedHandler(PageCollection_Edited);
     pageCollection.Deleted += new DeletedHandler(PageCollection_Deleted);
     pageCollection.MoveUpRequest += new EventHandler(pageCollection_MoveUpRequest);
     pageCollection.MoveDownRequest += new EventHandler(pageCollection_MoveDownRequest);
 }