ContextNode.ParentNode Property
Gets the parent node of the ContextNode in the context node tree.
Namespace: System.Windows.Ink
Assembly: IAWinFX (in IAWinFX.dll)
Syntax
'Declaration
Public ReadOnly Property ParentNode As ContextNode
'Usage
Dim instance As ContextNode
Dim value As ContextNode
value = instance.ParentNode
public ContextNode ParentNode { get; }
public:
property ContextNode^ ParentNode {
ContextNode^ get ();
}
public function get ParentNode () : ContextNode
Property Value
Type: System.Windows.Ink.ContextNode
The parent node of the ContextNode.
Remarks
Returns nulla null reference (Nothing in Visual Basic) if this is the RootNode.
Examples
This example uses a [System.Windows.Controls.TreeView] named theTreeView. Each TreeViewItem has its [System.Windows.FrameworkElement.Tag] property set to a ContextNode. The example finds the selected node and then uses ParentNode to find its parent. After the parent node is found, it calls the MarkNodeAsRed method to change the node's strokes to red.
Dim selectedNode As ContextNode = CType(selectedTreeItem.Tag, ContextNode)
Dim parentNode As ContextNode = selectedNode.ParentNode
If Not (parentNode Is Nothing) Then
MarkNodeAsRed(parentNode)
End If
ContextNode selectedNode = (ContextNode)selectedTreeItem.Tag;
ContextNode parentNode = selectedNode.ParentNode;
if (parentNode != null)
{
MarkNodeAsRed(parentNode);
}
Platforms
Windows 7, Windows Vista, Windows XP SP2, Windows Server 2008 R2, Windows Server 2008, Windows Server 2003
The .NET Framework and .NET Compact Framework do not support all versions of every platform. For a list of the supported versions, see .NET Framework System Requirements.
Version Information
.NET Framework
Supported in: 3.0