InkCanvas.DefaultDrawingAttributes Property


The .NET API Reference documentation has a new home. Visit the .NET API Browser on to see the new experience.

Gets or sets the drawing attributes that are applied to new ink strokes made on the InkCanvas.

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

member DefaultDrawingAttributes : DrawingAttributes with get, set

Property Value

Type: System.Windows.Ink.DrawingAttributes

The default drawing attributes for the InkCanvas.

Setting this property will affect only new strokes that are made after this property is set. To apply new drawing attributes to already-created Stroke objects, access them individually using the Strokes property.

Identifier field


Metadata properties set to true


The following example demonstrates how to use two DrawingAttributes objects to simulate the experience of using a pen and a highlighter on the same InkCanvas. The example assumes that the root element in the markup language (XAML) file is a DockPanel called root. It also assumes that there is a Button called switchHilighter and that the Click event is connected to the event handler.

No code example is currently available or this language may not be supported.

The following example demonstrates how to bind the DefaultDrawingAttributes property to a data source.

.NET Framework
Available since 3.0
Return to top