private Page WalkTocNodesForPageID(TOCList nodes, Guid pageID) { foreach (TOCNode tocNode in nodes) { if (tocNode.ResourceIdentifier == pageID) { return((Page)tocNode.Resource); } if (tocNode.Children != null) { Page pageFromChildren = WalkTocNodesForPageID(tocNode.Children, pageID); if (pageFromChildren != null) { return(pageFromChildren); } } } return(null); }
private TOCNode WalkTOCNodes(TOCList tocNodes, Page page) { foreach (TOCNode tocNode in tocNodes) { if (tocNode.ResourceIdentifier == page.Identifier) { return(tocNode); } if (tocNode.Children != null) { TOCNode tocNodeFromChildren = WalkTOCNodes(tocNode.Children, page); if (tocNodeFromChildren != null) { return(tocNodeFromChildren); } } } return(null); }
private void TOCListLoaded(object sender, RoutedEventArgs e) { TOCList.ScrollIntoView(TOCList.SelectedItem); }
private Page WalkTocNodesForPageID( TOCList nodes, Guid pageID ) { foreach ( TOCNode tocNode in nodes ) { if ( tocNode.ResourceIdentifier == pageID ) { return (Page)tocNode.Resource; } if ( tocNode.Children != null ) { Page pageFromChildren = WalkTocNodesForPageID( tocNode.Children, pageID ); if (pageFromChildren != null) { return pageFromChildren; } } } return null; }
private TOCNode WalkTOCNodes ( TOCList tocNodes, Page page ) { foreach ( TOCNode tocNode in tocNodes ) { if ( tocNode.ResourceIdentifier == page.Identifier ) { return tocNode; } if ( tocNode.Children != null ) { TOCNode tocNodeFromChildren = WalkTOCNodes ( tocNode.Children, page ); if (tocNodeFromChildren != null) { return tocNodeFromChildren; } } } return null; }