InkPresenter.Strokes Property

Microsoft Silverlight will reach end of support after October 2021. Learn more.

Gets or sets the strokes that the InkPresenter displays.

Namespace:  System.Windows.Controls
Assembly:  System.Windows (in System.Windows.dll)

Syntax

'Declaration
Public Property Strokes As StrokeCollection
public StrokeCollection Strokes { get; set; }
<!--see Remarks; XAML usage is uncommon-->
<InkPresenter>
  <InkPresenter.Strokes>
    oneOrMoreStrokes
  </InkPresenter.Strokes>
</InkPresenter>

XAML Values

  • oneOrMoreStrokes
    One or more Stroke object elements.

Property Value

Type: System.Windows.Ink.StrokeCollection
The collection of ink strokes that are displayed by the InkPresenter.

Remarks

Dependency property identifier field: StrokesProperty

In practical terms, you would generally never replace the complete Strokes collection (by using the "set" aspect of this property). However, when the collection of strokes is populated by user input, you might add, remove, or query stroke items from the existing collection. Typically you do this by handling user input events on a stylus device or mouse, creating new Stroke objects based on starting and ending positions during user actions, and adding these strokes to the collection.

In order to render, each Stroke in the collection held by Strokes must also have values established for the DrawingAttributes property.

Version Information

Silverlight

Supported in: 5, 4, 3

Silverlight for Windows Phone

Supported in: Windows Phone OS 7.1, Windows Phone OS 7.0

Platforms

For a list of the operating systems and browsers that are supported by Silverlight, see Supported Operating Systems and Browsers.