Пример #1
0
        //navigate to a project using a project object
        public void NavigateToProject(Project project)
        {
            String projectTitle = project.title;

            if (!appProjects.Contains(projectTitle))
            {
                appProjects.Add(projectTitle);
            }                                                                          //for newly created projects


            //load fields of project from DB if they are not already in memory
            if (project.subtitle == null)
            {
                //currentProject.subtitle = LoadString("select subtitle from UserProjects where title = '" + projectTitle + "'");
            }
            if (project.background_image == null)
            {
                //currentProject.background_image = (Image)LoadProjectData("select background_image from UserProjects where title = '" + projectTitle + "'");
            }
            project.LoadTopicsIfNeeded();
            project.LoadTagsIfNeeded();
            project.LoadConnectionsIfNeeded();

            //Can't call navigate to page because a different order of events is required
            WoPage newpage = new WoPage();

            newpage.project = project;
            newpage.control = new ProjectHomeUserControl(newpage.project);
            UpdateHistoryNew(newpage);
            woDisplayedContent.Content = newpage.control;
        }
Пример #2
0
        private void NewTopicCommand_Executed(object sender, ExecutedRoutedEventArgs e)
        {
            WoPage newpage = new WoPage();

            newpage.project = currentPage.project;
            newpage.control = new NewTopicUserControl();
            NavigateToPage(newpage);
        }
Пример #3
0
        public void LinkToTopic(Object sender, RoutedEventArgs e)
        {
            String  topicTitle = (sender as TextBlock).Text;
            Project project    = theWindow.currentPage.project;
            Topic   topic      = project.GetTopic(topicTitle);
            WoPage  page       = new WoPage(new ViewTopicUserControl(topic), project);

            theWindow.NavigateToPage(page);
        }
Пример #4
0
        //navigates to a WoPage without the caller having to provide a WoPage struct
        public void NavigateToPage(UserControl control, Project project)
        {
            WoPage newpage = new WoPage();

            newpage.control = control;
            newpage.project = project;
            NavigateToPage(newpage);
            TheWindowScrollBar.ScrollToTop();
        }
Пример #5
0
        /**Application Navigation Functionality**/

        //updates the navigation history; called when a new page is visited
        private void UpdateHistoryNew(WoPage newpage)
        {
            //Don't add pages with unsaved input to history
            if (!(currentPage.control is NewTopicUserControl || currentPage.control is EditTopicUserControl))
            {
                prevPages.Push(currentPage);
            }
            currentPage = newpage;
            //clear the forward history, since a new path has been entered
            forwardPages.Clear();
        }
Пример #6
0
        public void LinkToAppHome(Object sender, RoutedEventArgs e)
        {
            WoPage page = new WoPage(new AppNexusUserControl(), null);

            theWindow.NavigateToPage(page);
        }
Пример #7
0
 //navigates to a WoPage
 public void NavigateToPage(WoPage newpage)
 {
     woDisplayedContent.Content = newpage.control;
     UpdateHistoryNew(newpage);
 }
Пример #8
0
 //updates the navigation history; called when back button is clicked
 private void BackButton_Executed(object sender, ExecutedRoutedEventArgs e)
 {
     forwardPages.Push(currentPage);
     currentPage = prevPages.Pop();
     woDisplayedContent.Content = currentPage.control;
 }
Пример #9
0
 public void ReturnToPrevPage()
 {
     currentPage = prevPages.Pop();
     woDisplayedContent.Content = currentPage.control;
 }