次の方法で共有


ContextNode.Strokes プロパティ

この ContextNode に関連付けられている StrokeCollection を取得します。

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

構文

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

value = instance.Strokes
public StrokeCollection Strokes { get; }
public:
property StrokeCollection^ Strokes {
    StrokeCollection^ get ();
}
/** @property */
public StrokeCollection get_Strokes()
public function get Strokes () : StrokeCollection

プロパティ値

型 : System.Windows.Ink.StrokeCollection
ContextNode に関連付けられている StrokeCollection

解説

ContextNode がリーフ ノードでない場合、このプロパティはすべてのリーフの子孫を構成するストロークを返します。

ノードが、TextWordNodeImageNodeAnalysisHintNode などのストロークを持たない型の場合、このプロパティは空のストローク コレクションを返します。

この例では、赤の DrawingAttributesContextNode のストロークに割り当て、既定の描画属性を他のすべてのストロークに割り当てるメソッドを示します。ストロークを収集する theInkCanvas という InkCanvas

Sub MarkNodeAsRed(ByVal selectedNode As ContextNode)
    ' Set all node strokes to black, but this one to red
    Dim stroke As Stroke
    For Each stroke In Me.theInkCanvas.Strokes
        If Not (selectedNode Is Nothing) AndAlso selectedNode.Strokes.Contains(stroke) Then
            stroke.DrawingAttributes.Color = Colors.Red
        Else
            stroke.DrawingAttributes.Color = Me.theInkCanvas.DefaultDrawingAttributes.Color
        End If
    Next stroke

End Sub 'theResultsTreeView_SelectedItemChanged 
private void MarkNodeAsRed(ContextNode selectedNode)
{
    // Set all node strokes to black, but this one to red
    foreach (Stroke stroke in this.theInkCanvas.Strokes)
    {
        if (selectedNode != null &&
            selectedNode.Strokes.Contains(stroke))
            stroke.DrawingAttributes.Color = Colors.Red;
        else
            stroke.DrawingAttributes.Color = 
                this.theInkCanvas.DefaultDrawingAttributes.Color;
    }
}

プラットフォーム

Windows Vista

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

バージョン情報

.NET Framework

サポート対象 : 3.0

参照

参照

ContextNode クラス

ContextNode メンバ

System.Windows.Ink 名前空間

System.Windows.Ink.StrokeCollection