Exemplo n.º 1
0
        private void DeleteThisSectionButton_Click(object sender, RoutedEventArgs e)
        {
            SectionTemplateItem sti = (SectionTemplateItem)this.Parent;
            PageTemplateItem    pti = (PageTemplateItem)sti.Parent;

            pti.PageTemplate.Sections.Remove(SectionTemplate);
        }
Exemplo n.º 2
0
        private void InitTemplateTree()
        {
            PageTemplateItem pageRoot = new PageTemplateItem(Workflow.PageTemplate);

            ConfigTree.Items.Add(pageRoot);

            foreach (SectionTemplate st in Workflow.PageTemplate.Sections)
            {
                SectionTemplateItem sectionFolder = new SectionTemplateItem(st);
                pageRoot.Items.Add(sectionFolder);

                foreach (ArticleTemplate at in st.Articles)
                {
                    /*ArticleTemplateEditor ate = new ArticleTemplateEditor() { ArticleTemplate = at };
                     * TreeViewItem articleLeaf = new TreeViewItem() { Header = ate };*/
                    ArticleTemplateItem articleLeaf = new ArticleTemplateItem(at);
                    sectionFolder.Items.Add(articleLeaf);
                }
            }

            pageRoot.ExpandSubtree();
        }