Creating Different Views in the ContextViewManager in WPF Diagram

5 May 20211 minute to read

ContextViewManager can be used to choose any one of the three different views. The nodes and connection will be created based on the view chosen.

  1. Predecessors View: The predecessors view is used to display all hierarchical parent nodes of the selected node in a layout manner.
  2. Successors View: The successor view displays all the hierarchical child nodes of the selected node.
  3. Neighborhood View: This view will be used to show immediate child and parent nodes of the selected node.

The following code example explains how to choose the predecessors view

  • VBNET
  • Create ContextViewManager to attach source and target diagrams.
    
    Dim ContextView As New ContextViewManager(source, target)
    
    'Set ContextViewMode as Predecessors.
    
    ContextView.ContextViewMode =ContextViewMode.Predecessors

    Diagram-View_img53

    Context View

    NOTE

    By default, the context view manager will show the neighborhood view.