public LinkTab 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 LinkTab; if (l == null) { continue; } if (l.ItemUri != itemUri) { continue; } t.IsSelected = true; return(l); } var tabItem = new TabItem(); var tab = new LinkTab { ItemUri = itemUri, LinkViewer = 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 LinksContext([NotNull] LinkTab linkTab) { Assert.ArgumentNotNull(linkTab, nameof(linkTab)); LinkTab = linkTab; }