次の方法で共有


ContextNode.ParentNode プロパティ

コンテキスト ノード ツリー内の ContextNode の親ノードを取得します。

名前空間 :  System.Windows.Ink
アセンブリ :  IAWinFX (IAWinFX.dll 内)

構文

'宣言
Public ReadOnly Property ParentNode As ContextNode
'使用
Dim instance As ContextNode
Dim value As ContextNode

value = instance.ParentNode
public ContextNode ParentNode { get; }
public:
property ContextNode^ ParentNode {
    ContextNode^ get ();
}
/** @property */
public ContextNode get_ParentNode()
public function get ParentNode () : ContextNode

プロパティ値

型 : System.Windows.Ink.ContextNode
ContextNode の親ノード。

解説

これが RootNode の場合、nullnull 参照 (Visual Basic では Nothing) を返します。

この例では、theTreeView という [System.Windows.Controls.TreeView] を使用します。各 TreeViewItem の [System.Windows.FrameworkElement.Tag] プロパティは ContextNode に設定されています。この例では、選択されたノードを見つけ、ParentNode を使用してその親を見つけます。親ノードが見つかったら、MarkNodeAsRed メソッドが呼び出されてノードのストロークが赤色に変更されます。

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);
}

プラットフォーム

Windows Vista

.NET Framework および .NET Compact Framework では、各プラットフォームのすべてのバージョンはサポートしていません。サポートされているバージョンについては、「.NET Framework システム要件」を参照してください。

バージョン情報

.NET Framework

サポート対象 : 3.0

参照

参照

ContextNode クラス

ContextNode メンバ

System.Windows.Ink 名前空間

ContextNode.SubNodes