//called by DisplayTopicInfo private void LoadTags() { foreach (String tag in theWindow.currentPage.project.GetAssociatedTags(this.topic.title)) { TagsPanel.Children.Add(HelpFunctions.CreateTagBlock(tag)); } }
private void AddTag(Object sender, RoutedEventArgs e) { String tagName = ((sender as MenuItem).Header) as String; TextBlock tagBlock = HelpFunctions.CreateTagBlock(tagName); TagsPanel.Children.Add(tagBlock); tagsToAdd.Add(tagName, tagBlock); //remove from contextmenu TagOptionsDropDown.Items.Remove(possibleTags[tagName]); }
private TextBlock MakeTagBlock(String tag) { TextBlock tagUI = HelpFunctions.CreateTagBlock(tag); tagUI.ContextMenu = new ContextMenu(); tagUI.ContextMenu.PlacementTarget = tagUI; tagUI.ContextMenu.Items.Add(new MenuItem()); ((MenuItem)tagUI.ContextMenu.Items[0]).Header = "Remove"; ((MenuItem)tagUI.ContextMenu.Items[0]).Click += RemoveTag_Clicked; return(tagUI); }