Shape Navigation Example for WPF

Nevron NOV Diagram for WPF ships with hundreds of examples with full source code, as part of the Nevron Open Vision Suite. All WPF Diagram examples are also available as a stand-alone Visual Studio solution in C# and VB.NET, which you can download from the links below.

Shape Navigation Example for WPF Description

This example demonstrates how to use the NOV Diagram API to navigate between shapes. Use the controls on the right to specify which shape should be highlighted and then select a shape from the drawing view. The shapes you have selected will be highlighted based on the selected shape.


Shape Navigation Example

C# Shape Navigation Example Code for Nevron Diagram for WPF
Language: C#

using Nevron.Nov;
using Nevron.Nov.DataStructures;
using Nevron.Nov.Diagram;
using Nevron.Nov.Diagram.Shapes;
using Nevron.Nov.Dom;
using Nevron.Nov.Graphics;
using Nevron.Nov.Layout;
using Nevron.Nov.UI;
using Nevron.Nov.Windows.Forms;
using System.Windows.Forms;

namespace NovWinFormsProject
{
	public partial class Form1 : Form
	{
		#region Constructors

		public Form1()
		{
			InitializeComponent();

			// Set form title
			Text = "NOV WinForms - NShapeNavigationExample";

			// Create the NOV example and its controls
			NWidget exampleContent = CreateExampleContent();
			NWidget exampleControls = CreateExampleControls();
			if (exampleControls != null)
			{
				exampleControls.PreferredWidth = 300;
			}

			// Place the example and its controls in a pair box
			NPairBox pairBox = new NPairBox(exampleContent, exampleControls);
			pairBox.FillMode = ENStackFillMode.First;
			pairBox.FitMode = ENStackFitMode.First;
			pairBox.Margins = new NMargins(NDesign.HorizontalSpacing, NDesign.VerticalSpacing);

			// Host the example in the form
			NNovWidgetHost host = new NNovWidgetHost(pairBox);
			host.Dock = DockStyle.Fill;
			Controls.Add(host);
		}

		#endregion

		#region Example

		public NWidget CreateExampleContent()
		{
			NDrawingViewWithRibbon drawingViewWithRibbon = new NDrawingViewWithRibbon();
			m_DrawingView = drawingViewWithRibbon.View;

			m_DrawingView.Document.HistoryService.Pause();
			try
			{
				InitDiagram(m_DrawingView.Document);
			}
			finally
			{
				m_DrawingView.Document.HistoryService.Resume();
			}

			return drawingViewWithRibbon;
		}
		public NWidget CreateExampleControls()
		{
			NMargins innerPadding = new NMargins(30, 0, 0, 0);

			NStackPanel vertexStack = new NStackPanel();
			{
				// Edges
				m_AllEdgesCheckBox = new NCheckBox("All edges");
				m_AllEdgesCheckBox.CheckedChanged += AllEdgesCheckBox_CheckedChanged;
				vertexStack.Add(m_AllEdgesCheckBox);

				m_IncomingEdgesCheckBox = new NCheckBox("Incoming edges");
				m_IncomingEdgesCheckBox.Padding = innerPadding;
				m_IncomingEdgesCheckBox.CheckedChanged += CheckBox_CheckedChanged;
				vertexStack.Add(m_IncomingEdgesCheckBox);

				m_OutgoingEdgesCheckBox = new NCheckBox("Outgoing edges");
				m_OutgoingEdgesCheckBox.Padding = innerPadding;
				m_OutgoingEdgesCheckBox.CheckedChanged += CheckBox_CheckedChanged;
				vertexStack.Add(m_OutgoingEdgesCheckBox);

				// Neighbour vertices
				m_NeighbourVerticesCheckBox = new NCheckBox("Neighbour vertices");
				m_NeighbourVerticesCheckBox.CheckedChanged += NeighbourVerticesCheckBox_CheckedChanged;
				vertexStack.Add(m_NeighbourVerticesCheckBox);

				m_SourceVerticesCheckBox = new NCheckBox("Source vertices");
				m_SourceVerticesCheckBox.Padding = innerPadding;
				m_SourceVerticesCheckBox.CheckedChanged += CheckBox_CheckedChanged;
				vertexStack.Add(m_SourceVerticesCheckBox);

				m_DestinationVerticesCheckBox = new NCheckBox("Destination vertices");
				m_DestinationVerticesCheckBox.Padding = innerPadding;
				m_DestinationVerticesCheckBox.CheckedChanged += CheckBox_CheckedChanged;
				vertexStack.Add(m_DestinationVerticesCheckBox);

				// Accessible vertices
				m_AccessibleVerticesCheckBox = new NCheckBox("Accessible vertices");
				m_AccessibleVerticesCheckBox.CheckedChanged += AccessibleVerticesCheckBox_CheckedChanged;
				vertexStack.Add(m_AccessibleVerticesCheckBox);

				m_PredecessorVerticesCheckBox = new NCheckBox("Predecessor vertices");
				m_PredecessorVerticesCheckBox.Padding = innerPadding;
				m_PredecessorVerticesCheckBox.CheckedChanged += CheckBox_CheckedChanged;
				vertexStack.Add(m_PredecessorVerticesCheckBox);

				m_SuccessorVerticesCheckBox = new NCheckBox("Successor vertices");
				m_SuccessorVerticesCheckBox.Padding = innerPadding;
				m_SuccessorVerticesCheckBox.CheckedChanged += CheckBox_CheckedChanged;
				vertexStack.Add(m_SuccessorVerticesCheckBox);
			}

			NStackPanel edgesStack = new NStackPanel();
			{
				m_FromVertexCheckBox = new NCheckBox("From vertex");
				m_FromVertexCheckBox.CheckedChanged += CheckBox_CheckedChanged;
				edgesStack.Add(m_FromVertexCheckBox);

				m_ToVertexCheckBox = new NCheckBox("To vertex");
				m_ToVertexCheckBox.CheckedChanged += CheckBox_CheckedChanged;
				edgesStack.Add(m_ToVertexCheckBox);
			}

			NPairBox pairBox = new NPairBox(
				new NGroupBox("Selected vertex highlights:", vertexStack),
				new NGroupBox("Selected edge highlights:", edgesStack),
				ENPairBoxRelation.Box1AboveBox2);
			pairBox.VerticalPlacement = ENVerticalPlacement.Top;
			return pairBox;
		}
		public string GetExampleDescription()
		{
			return @"

This example demonstrates how to use the NOV Diagram API to navigate between shapes. Use the controls on the right to specify which shape should be highlighted and then select a shape from the drawing view. The shapes you have selected will be highlighted based on the selected shape.

"; } /// /// Gets the relevant documentation links for the example /// /// public (string Name, string Url)[] GetDocumentationUrls() { return new[] { ("Shape Navigation", "https://www.nevron.com/docs/openvision/diagram-shape-navigation.html"), ("Shapes", "https://www.nevron.com/docs/openvision/diagram-shapes.html"), }; } private void InitDiagram(NDrawingDocument drawingDocument) { NDrawing drawing = drawingDocument.Content; drawing.ScreenVisibility.ShowPorts = false; drawing.ActivePage.Selection.Mode = ENSelectionMode.Single; drawing.ActivePage.Selection.Deselected += OnPageItemDeselected; drawing.ActivePage.Selection.Selected += OnPageItemSelected; // Add a stylesheet for highlighted shapes NStyleSheet styleSheet = new NStyleSheet(); drawingDocument.StyleSheets.Add(styleSheet); NRule rule = styleSheet.CreateRule(sb => { sb.Type(NGeometry.NGeometrySchema); sb.ChildOf(); sb.Type(NShape.NShapeSchema); sb.UserClass(HighlightedUserClassName); }); rule.Declarations.Add(new NValueDeclaration(NGeometry.FillProperty, new NColorFill(NColor.FromARGB(80, 255, 0, 0)))); rule.Declarations.Add(new NValueDeclaration(NGeometry.StrokeProperty, new NStroke(2, NColor.Red))); rule = styleSheet.CreateRule(sb => { sb.Type(NGeometry.NGeometrySchema); sb.ChildOf(); sb.Type(NShape.NShapeSchema); sb.UserClass(NDR.StyleSheetNameConnectors); sb.UserClass(HighlightedUserClassName); }); rule.Declarations.Add(new NValueDeclaration(NGeometry.EndArrowheadProperty, new NArrowhead(ENArrowheadShape.Triangle))); // Create a rectangular grid template NGraphTemplate template = new NRectangularGridTemplate(); template.Origin = new NPoint(10, 23); template.VertexShape = ENBasicShape.Rectangle; template.EdgeUserClass = NDR.StyleSheetNameConnectors; template.Create(drawingDocument); // Create a tree template template = new NGenericTreeTemplate(); template.Origin = new NPoint(250, 23); template.VertexShape = ENBasicShape.Triangle; template.EdgeUserClass = NDR.StyleSheetNameConnectors; template.Create(drawingDocument); // Create an elliptical grid template template = new NEllipticalGridTemplate(); template.Origin = new NPoint(10, 250); template.VertexShape = ENBasicShape.Ellipse; template.EdgeUserClass = NDR.StyleSheetNameConnectors; template.Create(drawingDocument); } private void ClearHighlightedShapes() { // Remove the highligthed user class of all shapes NList shapes = m_DrawingView.ActivePage.GetShapes(false); for (int i = 0; i < shapes.Count; i++) { shapes[i].RemoveUserClass(HighlightedUserClassName); } } private void HighlightShapes() { ClearHighlightedShapes(); // Highlight the selected type of shapes NShape shape = m_DrawingView.ActivePage.Selection.FirstSelected as NShape; if (shape == null) return; if (shape.ShapeType == ENShapeType.Shape2D) { // The selected shape is a 2D shape if (m_IncomingEdgesCheckBox.Checked) { HighlightShapes(shape.GetIncomingShapes()); } if (m_OutgoingEdgesCheckBox.Checked) { HighlightShapes(shape.GetOutgoingShapes()); } if (m_SourceVerticesCheckBox.Checked) { HighlightShapes(shape.GetSourceShapes()); } if (m_DestinationVerticesCheckBox.Checked) { HighlightShapes(shape.GetDestinationShapes()); } if (m_PredecessorVerticesCheckBox.Checked) { HighlightShapes(shape.GetPredecessorShapes()); } if (m_SuccessorVerticesCheckBox.Checked) { HighlightShapes(shape.GetSuccessorShapes()); } } else { // The selected shape is a 1D shape if (m_FromVertexCheckBox.Checked) { shape.FromShape.AddUserClass(HighlightedUserClassName); } if (m_ToVertexCheckBox.Checked) { shape.ToShape.AddUserClass(HighlightedUserClassName); } } } private void HighlightShapes(NList shapes) { for (int i = 0; i < shapes.Count; i++) { shapes[i].AddUserClass(HighlightedUserClassName); } } #endregion #region Implementation #endregion #region Event Handlers private void CheckBox_CheckedChanged(NValueChangeEventArgs arg) { m_bUpdatingCheckBoxes = true; m_AllEdgesCheckBox.Checked = m_IncomingEdgesCheckBox.Checked && m_OutgoingEdgesCheckBox.Checked; m_NeighbourVerticesCheckBox.Checked = m_SourceVerticesCheckBox.Checked && m_DestinationVerticesCheckBox.Checked; m_AccessibleVerticesCheckBox.Checked = m_PredecessorVerticesCheckBox.Checked && m_SuccessorVerticesCheckBox.Checked; m_bUpdatingCheckBoxes = false; HighlightShapes(); } private void AllEdgesCheckBox_CheckedChanged(NValueChangeEventArgs arg) { if (m_bUpdatingCheckBoxes) return; m_IncomingEdgesCheckBox.Checked = (bool)arg.NewValue; m_OutgoingEdgesCheckBox.Checked = (bool)arg.NewValue; } private void NeighbourVerticesCheckBox_CheckedChanged(NValueChangeEventArgs arg) { if (m_bUpdatingCheckBoxes) return; m_SourceVerticesCheckBox.Checked = (bool)arg.NewValue; m_DestinationVerticesCheckBox.Checked = (bool)arg.NewValue; } private void AccessibleVerticesCheckBox_CheckedChanged(NValueChangeEventArgs arg) { if (m_bUpdatingCheckBoxes) return; m_PredecessorVerticesCheckBox.Checked = (bool)arg.NewValue; m_SuccessorVerticesCheckBox.Checked = (bool)arg.NewValue; } private void OnPageItemDeselected(NItemEventArgs arg) { ClearHighlightedShapes(); } private void OnPageItemSelected(NItemEventArgs arg) { HighlightShapes(); } #endregion #region Fields private NDrawingView m_DrawingView; private NCheckBox m_AllEdgesCheckBox; private NCheckBox m_IncomingEdgesCheckBox; private NCheckBox m_OutgoingEdgesCheckBox; private NCheckBox m_NeighbourVerticesCheckBox; private NCheckBox m_SourceVerticesCheckBox; private NCheckBox m_DestinationVerticesCheckBox; private NCheckBox m_AccessibleVerticesCheckBox; private NCheckBox m_PredecessorVerticesCheckBox; private NCheckBox m_SuccessorVerticesCheckBox; private NCheckBox m_FromVertexCheckBox; private NCheckBox m_ToVertexCheckBox; private bool m_bUpdatingCheckBoxes; #endregion #region Static Methods #endregion #region Constants private const string HighlightedUserClassName = "Highlighted"; #endregion #region Nested Types #endregion } }

Download a fully functional C# (.cs) Shape Navigation Example for WPF Solution

VB.NET Shape Navigation Example Code for Nevron Diagram for WPF
Language: VB.NET

Imports Nevron.Nov
Imports Nevron.Nov.DataStructures
Imports Nevron.Nov.Diagram
Imports Nevron.Nov.Diagram.Shapes
Imports Nevron.Nov.Dom
Imports Nevron.Nov.Graphics
Imports Nevron.Nov.Layout
Imports Nevron.Nov.UI
Imports Nevron.Nov.Windows.Wpf

Class MainWindow

#Region "Constructors"

	Public Sub New()
		' This call is required by the designer.
		InitializeComponent()

		' Add any initialization after the InitializeComponent() call.

		' Set form title
		Title = "NOV WPF - NShapeNavigationExample"

		' Create the NOV example and its controls
		Dim exampleContent As NWidget = CreateExampleContent()
		Dim exampleControls As NWidget = CreateExampleControls()
		If Not exampleControls Is Nothing Then
			exampleControls.PreferredWidth = 300
		End If

		' Place the example and its controls in a pair box
		Dim pairBox As NPairBox = New NPairBox(exampleContent, exampleControls)
		pairBox.FillMode = ENStackFillMode.First
		pairBox.FitMode = ENStackFitMode.First
		pairBox.Margins = New NMargins(NDesign.HorizontalSpacing, NDesign.VerticalSpacing)

		' Host the example in the form
		Dim host As NNovWidgetHost(Of NWidget) = New NNovWidgetHost(Of NWidget)(pairBox)
		Content = host
	End Sub


#End Region

#Region "Example"

        Public Function CreateExampleContent() As NWidget
            Dim drawingViewWithRibbon As NDrawingViewWithRibbon = New NDrawingViewWithRibbon()
            m_DrawingView = drawingViewWithRibbon.View

            m_DrawingView.Document.HistoryService.Pause()
            Try
                InitDiagram(m_DrawingView.Document)
            Finally
                m_DrawingView.Document.HistoryService.Resume()
            End Try

            Return drawingViewWithRibbon
        End Function
        Public Function CreateExampleControls() As NWidget
            Dim innerPadding As NMargins = New NMargins(30, 0, 0, 0)

            Dim vertexStack As NStackPanel = New NStackPanel()
            If True Then
                ' Edges
                m_AllEdgesCheckBox = New NCheckBox("All edges")
                Me.m_AllEdgesCheckBox.CheckedChanged += AddressOf AllEdgesCheckBox_CheckedChanged
                vertexStack.Add(m_AllEdgesCheckBox)

                m_IncomingEdgesCheckBox = New NCheckBox("Incoming edges")
                m_IncomingEdgesCheckBox.Padding = innerPadding
                Me.m_IncomingEdgesCheckBox.CheckedChanged += AddressOf CheckBox_CheckedChanged
                vertexStack.Add(m_IncomingEdgesCheckBox)

                m_OutgoingEdgesCheckBox = New NCheckBox("Outgoing edges")
                m_OutgoingEdgesCheckBox.Padding = innerPadding
                Me.m_OutgoingEdgesCheckBox.CheckedChanged += AddressOf CheckBox_CheckedChanged
                vertexStack.Add(m_OutgoingEdgesCheckBox)

                ' Neighbour vertices
                m_NeighbourVerticesCheckBox = New NCheckBox("Neighbour vertices")
                Me.m_NeighbourVerticesCheckBox.CheckedChanged += AddressOf NeighbourVerticesCheckBox_CheckedChanged
                vertexStack.Add(m_NeighbourVerticesCheckBox)

                m_SourceVerticesCheckBox = New NCheckBox("Source vertices")
                m_SourceVerticesCheckBox.Padding = innerPadding
                Me.m_SourceVerticesCheckBox.CheckedChanged += AddressOf CheckBox_CheckedChanged
                vertexStack.Add(m_SourceVerticesCheckBox)

                m_DestinationVerticesCheckBox = New NCheckBox("Destination vertices")
                m_DestinationVerticesCheckBox.Padding = innerPadding
                Me.m_DestinationVerticesCheckBox.CheckedChanged += AddressOf CheckBox_CheckedChanged
                vertexStack.Add(m_DestinationVerticesCheckBox)

                ' Accessible vertices
                m_AccessibleVerticesCheckBox = New NCheckBox("Accessible vertices")
                Me.m_AccessibleVerticesCheckBox.CheckedChanged += AddressOf AccessibleVerticesCheckBox_CheckedChanged
                vertexStack.Add(m_AccessibleVerticesCheckBox)

                m_PredecessorVerticesCheckBox = New NCheckBox("Predecessor vertices")
                m_PredecessorVerticesCheckBox.Padding = innerPadding
                Me.m_PredecessorVerticesCheckBox.CheckedChanged += AddressOf CheckBox_CheckedChanged
                vertexStack.Add(m_PredecessorVerticesCheckBox)

                m_SuccessorVerticesCheckBox = New NCheckBox("Successor vertices")
                m_SuccessorVerticesCheckBox.Padding = innerPadding
                Me.m_SuccessorVerticesCheckBox.CheckedChanged += AddressOf CheckBox_CheckedChanged
                vertexStack.Add(m_SuccessorVerticesCheckBox)
            End If

            Dim edgesStack As NStackPanel = New NStackPanel()
            If True Then
                m_FromVertexCheckBox = New NCheckBox("From vertex")
                Me.m_FromVertexCheckBox.CheckedChanged += AddressOf CheckBox_CheckedChanged
                edgesStack.Add(m_FromVertexCheckBox)

                m_ToVertexCheckBox = New NCheckBox("To vertex")
                Me.m_ToVertexCheckBox.CheckedChanged += AddressOf CheckBox_CheckedChanged
                edgesStack.Add(m_ToVertexCheckBox)
            End If

            Dim pairBox As NPairBox = New NPairBox(New NGroupBox("Selected vertex highlights:", vertexStack), New NGroupBox("Selected edge highlights:", edgesStack), ENPairBoxRelation.Box1AboveBox2)
            pairBox.VerticalPlacement = ENVerticalPlacement.Top
            Return pairBox
        End Function
        Public Function GetExampleDescription() As String
            Return "

This example demonstrates how to use the NOV Diagram API to navigate between shapes. Use the controls on the right to specify which shape should be highlighted and then select a shape from the drawing view. The shapes you have selected will be highlighted based on the selected shape.

" End Function ''' ''' Gets the relevant documentation links for the example ''' ''' Public Function GetDocumentationUrls() As (String, String)() Return {("Shape Navigation", "https://www.nevron.com/docs/openvision/diagram-shape-navigation.html"), ("Shapes", "https://www.nevron.com/docs/openvision/diagram-shapes.html")} End Function Private Sub InitDiagram(drawingDocument As NDrawingDocument) Dim drawing = drawingDocument.Content drawing.ScreenVisibility.ShowPorts = False drawing.ActivePage.Selection.Mode = ENSelectionMode.Single drawing.ActivePage.Selection.Deselected += AddressOf OnPageItemDeselected drawing.ActivePage.Selection.Selected += AddressOf OnPageItemSelected ' Add a stylesheet for highlighted shapes Dim styleSheet As NStyleSheet = New NStyleSheet() drawingDocument.StyleSheets.Add(styleSheet) Dim rule As NRule = styleSheet.CreateRule(Sub(sb) sb.Type(NGeometry.NGeometrySchema) sb.ChildOf() sb.Type(NShape.NShapeSchema) sb.UserClass(HighlightedUserClassName) End Sub) rule.Declarations.Add(New NValueDeclaration(Of NFill)(NGeometry.FillProperty, New NColorFill(NColor.FromARGB(80, 255, 0, 0)))) rule.Declarations.Add(New NValueDeclaration(Of NStroke)(NGeometry.StrokeProperty, New NStroke(2, NColor.Red))) rule = styleSheet.CreateRule(Sub(sb) sb.Type(NGeometry.NGeometrySchema) sb.ChildOf() sb.Type(NShape.NShapeSchema) sb.UserClass(NDR.StyleSheetNameConnectors) sb.UserClass(HighlightedUserClassName) End Sub) rule.Declarations.Add(New NValueDeclaration(Of NArrowhead)(NGeometry.EndArrowheadProperty, New NArrowhead(ENArrowheadShape.Triangle))) ' Create a rectangular grid template Dim template As NGraphTemplate = New NRectangularGridTemplate() template.Origin = New NPoint(10, 23) template.VertexShape = ENBasicShape.Rectangle template.EdgeUserClass = NDR.StyleSheetNameConnectors template.Create(drawingDocument) ' Create a tree template template = New NGenericTreeTemplate() template.Origin = New NPoint(250, 23) template.VertexShape = ENBasicShape.Triangle template.EdgeUserClass = NDR.StyleSheetNameConnectors template.Create(drawingDocument) ' Create an elliptical grid template template = New NEllipticalGridTemplate() template.Origin = New NPoint(10, 250) template.VertexShape = ENBasicShape.Ellipse template.EdgeUserClass = NDR.StyleSheetNameConnectors template.Create(drawingDocument) End Sub Private Sub ClearHighlightedShapes() ' Remove the highligthed user class of all shapes Dim shapes = m_DrawingView.ActivePage.GetShapes(False) For i = 0 To shapes.Count - 1 shapes(i).RemoveUserClass(HighlightedUserClassName) Next End Sub Private Sub HighlightShapes() ClearHighlightedShapes() ' Highlight the selected type of shapes Dim shape As NShape = TryCast(m_DrawingView.ActivePage.Selection.FirstSelected, NShape) If shape Is Nothing Then Return If shape.ShapeType Is ENShapeType.Shape2D Then ' The selected shape is a 2D shape If m_IncomingEdgesCheckBox.Checked Then HighlightShapes(shape.GetIncomingShapes()) End If If m_OutgoingEdgesCheckBox.Checked Then HighlightShapes(shape.GetOutgoingShapes()) End If If m_SourceVerticesCheckBox.Checked Then HighlightShapes(shape.GetSourceShapes()) End If If m_DestinationVerticesCheckBox.Checked Then HighlightShapes(shape.GetDestinationShapes()) End If If m_PredecessorVerticesCheckBox.Checked Then HighlightShapes(shape.GetPredecessorShapes()) End If If m_SuccessorVerticesCheckBox.Checked Then HighlightShapes(shape.GetSuccessorShapes()) End If Else ' The selected shape is a 1D shape If m_FromVertexCheckBox.Checked Then shape.FromShape.AddUserClass(HighlightedUserClassName) End If If m_ToVertexCheckBox.Checked Then shape.ToShape.AddUserClass(HighlightedUserClassName) End If End If End Sub Private Sub HighlightShapes(shapes As NList(Of NShape)) For i = 0 To shapes.Count - 1 shapes(i).AddUserClass(HighlightedUserClassName) Next End Sub #End Region #Region "Implementation" #End Region #Region "Event Handlers" Private Sub CheckBox_CheckedChanged(arg As NValueChangeEventArgs) m_bUpdatingCheckBoxes = True m_AllEdgesCheckBox.Checked = m_IncomingEdgesCheckBox.Checked AndAlso m_OutgoingEdgesCheckBox.Checked m_NeighbourVerticesCheckBox.Checked = m_SourceVerticesCheckBox.Checked AndAlso m_DestinationVerticesCheckBox.Checked m_AccessibleVerticesCheckBox.Checked = m_PredecessorVerticesCheckBox.Checked AndAlso m_SuccessorVerticesCheckBox.Checked m_bUpdatingCheckBoxes = False HighlightShapes() End Sub Private Sub AllEdgesCheckBox_CheckedChanged(arg As NValueChangeEventArgs) If m_bUpdatingCheckBoxes Then Return m_IncomingEdgesCheckBox.Checked = CBool(arg.NewValue) m_OutgoingEdgesCheckBox.Checked = CBool(arg.NewValue) End Sub Private Sub NeighbourVerticesCheckBox_CheckedChanged(arg As NValueChangeEventArgs) If m_bUpdatingCheckBoxes Then Return m_SourceVerticesCheckBox.Checked = CBool(arg.NewValue) m_DestinationVerticesCheckBox.Checked = CBool(arg.NewValue) End Sub Private Sub AccessibleVerticesCheckBox_CheckedChanged(arg As NValueChangeEventArgs) If m_bUpdatingCheckBoxes Then Return m_PredecessorVerticesCheckBox.Checked = CBool(arg.NewValue) m_SuccessorVerticesCheckBox.Checked = CBool(arg.NewValue) End Sub Private Sub OnPageItemDeselected(arg As NItemEventArgs(Of NPageItem)) ClearHighlightedShapes() End Sub Private Sub OnPageItemSelected(arg As NItemEventArgs(Of NPageItem)) HighlightShapes() End Sub #End Region #Region "Fields" Private m_DrawingView As NDrawingView Private m_AllEdgesCheckBox As NCheckBox Private m_IncomingEdgesCheckBox As NCheckBox Private m_OutgoingEdgesCheckBox As NCheckBox Private m_NeighbourVerticesCheckBox As NCheckBox Private m_SourceVerticesCheckBox As NCheckBox Private m_DestinationVerticesCheckBox As NCheckBox Private m_AccessibleVerticesCheckBox As NCheckBox Private m_PredecessorVerticesCheckBox As NCheckBox Private m_SuccessorVerticesCheckBox As NCheckBox Private m_FromVertexCheckBox As NCheckBox Private m_ToVertexCheckBox As NCheckBox Private m_bUpdatingCheckBoxes As Boolean #End Region #Region "Static Methods" #End Region #Region "Constants" Private Const HighlightedUserClassName As String = "Highlighted" #End Region #Region "Nested Types" #End Region End Class

Download a fully functional VB.NET (.vb) Shape Navigation Example for WPF Solution

Related Documentation Links