private void FillTopicSideBar(StackPanel OtherTopics) { List <String> projectTopics = theWindow.currentPage.project.GetTopicList(); foreach (String topicName in projectTopics) { String title = ""; if (parentControl is ViewTopicUserControl) { title = (parentControl as ViewTopicUserControl).topic.title; } else if (parentControl is EditTopicUserControl) { title = (parentControl as EditTopicUserControl).oldTitle; } //NewTopicUserControl doesn't have a title yet if (!topicName.Equals(title)) //don't give a link to the topic that's already displayed { WrapPanel cursorWrap = new WrapPanel(); //makes the space next to the topic link not accidentally clickable TextBlock topicLink = HelpFunctions.CreateSideBarLink(topicName); topicLink.Cursor = Cursors.Hand; topicLink.MouseUp += LinkToTopic; cursorWrap.Children.Add(topicLink); OtherTopics.Children.Add(cursorWrap); } } }
private void FillProjectSideBar(StackPanel OtherProjects) { List <String> appProjects = new List <string>(); foreach (String projectName in theWindow.appProjects) { if (!projectName.Equals((parentControl as ProjectHomeUserControl).project.title)) //don't give a link to the topic that's already displayed { WrapPanel cursorWrap = new WrapPanel(); TextBlock projectLink = HelpFunctions.CreateSideBarLink(projectName); projectLink.Cursor = Cursors.Hand; projectLink.MouseUp += LinkToTargetProject; cursorWrap.Children.Add(projectLink); OtherProjects.Children.Add(cursorWrap); } } }