DefaultDrawingAttributes Property

InkCanvas.DefaultDrawingAttributes Property


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)

public DrawingAttributes DefaultDrawingAttributes { 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.

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

.NET Framework
Available since 3.0
Return to top
© 2015 Microsoft