Pen Class

Summary

Describes how a stroke is drawn.
Namespace
Avalonia.Media
Interfaces
Base Types
graph BT Type-->Base0["AvaloniaObject"] click Base0 "/api/Avalonia/AvaloniaObject" Base0-->Base1["object"] Type-.->Interface0["IAvaloniaObject"] click Interface0 "/api/Avalonia/IAvaloniaObject" Type-.->Interface1["IAvaloniaObjectDebug"] click Interface1 "/api/Avalonia.Diagnostics/IAvaloniaObjectDebug" Type-.->Interface2["INotifyPropertyChanged"] Type-.->Interface3["IPen"] click Interface3 "/api/Avalonia.Media/IPen" Type["Pen"] class Type type-node

Syntax

public class Pen : AvaloniaObject, IAvaloniaObject, IAvaloniaObjectDebug, INotifyPropertyChanged, 
    IPen

Constructors

Name Summary
Pen() Initializes a new instance of the Pen class.
Pen(IBrush, double, IDashStyle, PenLineCap, PenLineJoin, double) Initializes a new instance of the Pen class.
Pen(uint, double, IDashStyle, PenLineCap, PenLineJoin, double) Initializes a new instance of the Pen class.

Events

Name Type Summary
Invalidated EventHandler
Raised when the pen changes.
PropertyChanged EventHandler<AvaloniaPropertyChangedEventArgs>
Raised when a AvaloniaProperty value changes on this object.
Inherited from AvaloniaObject

Fields

Name Constant Value Summary
BrushProperty
Defines the Brush property.
static
DashStyleProperty
Defines the DashStyle property.
static
LineCapProperty
Defines the LineCap property.
static
LineJoinProperty
Defines the LineJoin property.
static
MiterLimitProperty
Defines the MiterLimit property.
static
ThicknessProperty
Defines the Thickness property.
static

Properties

Name Value Summary
Brush IBrush
Gets or sets the brush used to draw the stroke.
DashStyle IDashStyle
Gets or sets the style of dashed lines drawn with a Pen object.
InheritanceParent IAvaloniaObject
Gets or sets the parent object that inherited AvaloniaProperty values are inherited from.
Inherited from AvaloniaObject
LineCap PenLineCap
Gets or sets the type of shape to use on both ends of a line.
LineJoin PenLineJoin
Gets or sets the join style for the ends of two consecutive lines drawn with this Pen.
MiterLimit double
Gets or sets the limit of the thickness of the join on a mitered corner.
Thickness double
Gets or sets the stroke thickness.
this[AvaloniaProperty] object
Gets or sets the value of a AvaloniaProperty.
Inherited from AvaloniaObject
this[IndexerDescriptor] IBinding
Gets or sets a binding for a AvaloniaProperty.
Inherited from AvaloniaObject

Methods

Name Value Summary
AffectsRender<T>(AvaloniaProperty[]) void
Marks a property as affecting the pen's visual representation.
static
AffectsValidation(AvaloniaProperty, AvaloniaProperty[]) void
Forces revalidation of properties when a property value changes.
Inherited from AvaloniaObject
static
Bind(AvaloniaProperty, IObservable<object>, BindingPriority) IDisposable
Binds a AvaloniaProperty to an observable.
Inherited from AvaloniaObject
Bind<T>(AvaloniaProperty<T>, IObservable<T>, BindingPriority) IDisposable
Binds a AvaloniaProperty to an observable.
Inherited from AvaloniaObject
CheckAccess() bool
Inherited from AvaloniaObject
ClearValue(AvaloniaProperty) void
Clears a AvaloniaProperty's local value.
Inherited from AvaloniaObject
Equals(object) bool
Compares two objects using reference equality.
Inherited from AvaloniaObject
GetHashCode() int
Gets the hash code for the object.
Inherited from AvaloniaObject
GetValue(AvaloniaProperty) object
Gets a AvaloniaProperty value.
Inherited from AvaloniaObject
GetValue<T>(AvaloniaProperty<T>) T
Gets a AvaloniaProperty value.
Inherited from AvaloniaObject
IsAnimating(AvaloniaProperty) bool
Checks whether a AvaloniaProperty is animating.
Inherited from AvaloniaObject
IsSet(AvaloniaProperty) bool
Checks whether a AvaloniaProperty is set on this object.
Inherited from AvaloniaObject
OnPropertyChanged(AvaloniaPropertyChangedEventArgs) void
Called when a avalonia property changes on the object.
Inherited from AvaloniaObject
RaiseInvalidated(EventArgs) void
Raises the Invalidated event.
Revalidate(AvaloniaProperty) void
Forces the specified property to be revalidated.
Inherited from AvaloniaObject
SetAndRaise<T>(AvaloniaProperty<T>, T, T) bool
Sets the backing field for a direct avalonia property, raising the PropertyChanged event if the value has changed.
Inherited from AvaloniaObject
SetValue(AvaloniaProperty, object, BindingPriority) void
Sets a AvaloniaProperty value.
Inherited from AvaloniaObject
SetValue<T>(AvaloniaProperty<T>, T, BindingPriority) void
Sets a AvaloniaProperty value.
Inherited from AvaloniaObject
ToImmutable() ImmutablePen
Creates an immutable clone of the brush.
UpdateDataValidation(AvaloniaProperty, BindingNotification) void
Called to update the validation state for properties for which data validation is enabled.
Inherited from AvaloniaObject
VerifyAccess() void
Inherited from AvaloniaObject

Extension Methods