Stroke.DrawingAttributes Property

[ This article is for Windows Phone 8 developers. If you’re developing for Windows 10, see the latest documentation. ]

Gets or sets the properties of the stroke, such as Height, Width, Color, or OutlineColor.

Namespace:  System.Windows.Ink
Assembly:  System.Windows (in System.Windows.dll)
XMLNS for XAML: Not mapped to an xmlns.

Syntax

Public Property DrawingAttributes As DrawingAttributes
public DrawingAttributes DrawingAttributes { get; set; }
<Stroke>
  <Stroke.DrawingAttributes>
    singleDrawingAttribute
  </Stroke.DrawingAttributes>
</Stroke>

XAML Values

  • singleDrawingAttribute
    A single DrawingAttributes object element. Typically this object element will also define attribute values for Height, Color, and so on.

Property Value

Type: System.Windows.Ink..::.DrawingAttributes
The DrawingAttributes of the stroke.

Remarks

DrawingAttributes is not a collection. It is a representative object that is used to set various properties of the object that is used in the stroke rendering. To set the DrawingAttributes property in XAML, you must use the property element syntax shown in the syntax and in the example.

Examples

The following code example demonstrates how to set the DrawingAttributes property. This is part of a larger example available in the DrawingAttributes class overview.

    'Set drawing attributes to simulate a highlighter
    Private Sub BtHighlighter_Click(ByVal sender As Object, ByVal e As EventArgs)
        MyDA.Width = 25
        MyDA.Height = 5
        MyDA.Color = Colors.Yellow
        MyDA.OutlineColor = Colors.Yellow
    End Sub

//Set drawing attributes to simulate a highlighter
private void BtHighlighter_Click(object sender, EventArgs e)
{
    MyDA.Width = 25;
    MyDA.Height = 5;
    MyDA.Color = Colors.Yellow;
    MyDA.OutlineColor = Colors.Yellow;
}

Version Information

Windows Phone OS

Supported in: 8.1, 8.0, 7.1, 7.0

Platforms

Windows Phone

See Also

Reference

Stroke Class

System.Windows.Ink Namespace

DrawingAttributes