private void pagesList_SelectionChanged(object sender, SelectionChangedEventArgs e) { pdf.Page page = pagesList.SelectedItem as pdf.Page; if (null != page) { initializeShapesTree(page); drawPage(page.Index); } }
void initializeShapesTree(pdf.Page page) { ShapeCollectionConverter.Reset(); pdf.Shapes.ShapeCollection shapes = page.CreateShapes(); pdf.Shapes.ShapeCollection root = new pdf.Shapes.ShapeCollection(); root.Add(shapes); (shapesTree.Items[0] as TreeViewItem).ItemsSource = root; (shapesTree.Items[0] as TreeViewItem).IsExpanded = true; }