public TemplateHierarchyItemTreeViewContext([NotNull] ItemTreeView contentTree, [NotNull] IEnumerable <BaseTreeViewItem> selectedItems, [NotNull] TemplateHierarchyTab templateHierarchyTab) : base(contentTree, selectedItems)
        {
            Assert.ArgumentNotNull(contentTree, nameof(contentTree));
            Assert.ArgumentNotNull(selectedItems, nameof(selectedItems));
            Assert.ArgumentNotNull(templateHierarchyTab, nameof(templateHierarchyTab));

            TemplateHierarchyTab = templateHierarchyTab;
        }
        public TemplateHierarchyTab CreateTab([NotNull] ItemUri itemUri)
        {
            Assert.ArgumentNotNull(itemUri, nameof(itemUri));

            foreach (var i in Tabs.Items)
            {
                var t = i as TabItem;
                if (t == null)
                {
                    continue;
                }

                var l = t.Content as TemplateHierarchyTab;
                if (l == null)
                {
                    continue;
                }

                if (l.TemplateUri != itemUri)
                {
                    continue;
                }

                t.IsSelected = true;
                return(l);
            }

            var tabItem = new TabItem();

            var tab = new TemplateHierarchyTab
            {
                TemplateUri             = itemUri,
                TemplateHierarchyViewer = this,
                TabItem = tabItem
            };

            var tabHeader = new TabItemHeader
            {
                Header = Rocks.Resources.LinkViewer_CreateTab_Loading___,
                Tag    = tab
            };

            tabHeader.Click += delegate { CloseTab(tabItem); };
            tabItem.Header   = tabHeader;

            Tabs.Items.Add(tabItem);

            tabItem.Content = tab;

            tabItem.IsSelected = true;

            EnableTabs();

            return(tab);
        }
        public TemplateHierarchyFieldsContext([NotNull] TemplateHierarchyTab templateHierarchyTab)
        {
            Assert.ArgumentNotNull(templateHierarchyTab, nameof(templateHierarchyTab));

            TemplateHierarchyTab = templateHierarchyTab;
        }