diff --git a/src/Avalonia.Controls/Shapes/Shape.cs b/src/Avalonia.Controls/Shapes/Shape.cs
index 371b5d92f7..fc939d2a38 100644
--- a/src/Avalonia.Controls/Shapes/Shape.cs
+++ b/src/Avalonia.Controls/Shapes/Shape.cs
@@ -4,36 +4,63 @@ using Avalonia.Media;
namespace Avalonia.Controls.Shapes
{
+ ///
+ /// Provides a base class for shape elements, such as , and .
+ ///
public abstract class Shape : Control
{
+ ///
+ /// Defines the property.
+ ///
public static readonly StyledProperty FillProperty =
AvaloniaProperty.Register(nameof(Fill));
+ ///
+ /// Defines the property.
+ ///
public static readonly StyledProperty StretchProperty =
AvaloniaProperty.Register(nameof(Stretch));
+ ///
+ /// Defines the property.
+ ///
public static readonly StyledProperty StrokeProperty =
AvaloniaProperty.Register(nameof(Stroke));
+ ///
+ /// Defines the property.
+ ///
public static readonly StyledProperty> StrokeDashArrayProperty =
AvaloniaProperty.Register>(nameof(StrokeDashArray));
+ ///
+ /// Defines the property.
+ ///
public static readonly StyledProperty StrokeDashOffsetProperty =
AvaloniaProperty.Register(nameof(StrokeDashOffset));
+ ///
+ /// Defines the property.
+ ///
public static readonly StyledProperty StrokeThicknessProperty =
AvaloniaProperty.Register(nameof(StrokeThickness));
+ ///
+ /// Defines the property.
+ ///
public static readonly StyledProperty StrokeLineCapProperty =
AvaloniaProperty.Register(nameof(StrokeLineCap), PenLineCap.Flat);
+ ///
+ /// Defines the property.
+ ///
public static readonly StyledProperty StrokeJoinProperty =
AvaloniaProperty.Register(nameof(StrokeJoin), PenLineJoin.Miter);
private Matrix _transform = Matrix.Identity;
private Geometry _definingGeometry;
private Geometry _renderedGeometry;
- bool _calculateTransformOnArrange = false;
+ private bool _calculateTransformOnArrange;
static Shape()
{
@@ -43,6 +70,9 @@ namespace Avalonia.Controls.Shapes
StrokeThicknessProperty, StrokeLineCapProperty, StrokeJoinProperty);
}
+ ///
+ /// Gets a value that represents the of the shape.
+ ///
public Geometry DefiningGeometry
{
get
@@ -56,12 +86,9 @@ namespace Avalonia.Controls.Shapes
}
}
- public IBrush Fill
- {
- get { return GetValue(FillProperty); }
- set { SetValue(FillProperty, value); }
- }
-
+ ///
+ /// Gets a value that represents the final rendered of the shape.
+ ///
public Geometry RenderedGeometry
{
get
@@ -93,42 +120,72 @@ namespace Avalonia.Controls.Shapes
}
}
+ ///
+ /// Gets or sets the that specifies how the shape's interior is painted.
+ ///
+ public IBrush Fill
+ {
+ get { return GetValue(FillProperty); }
+ set { SetValue(FillProperty, value); }
+ }
+
+ ///
+ /// Gets or sets a enumeration value that describes how the shape fills its allocated space.
+ ///
public Stretch Stretch
{
get { return GetValue(StretchProperty); }
set { SetValue(StretchProperty, value); }
}
+ ///
+ /// Gets or sets the that specifies how the shape's outline is painted.
+ ///
public IBrush Stroke
{
get { return GetValue(StrokeProperty); }
set { SetValue(StrokeProperty, value); }
}
+ ///
+ /// Gets or sets a collection of values that indicate the pattern of dashes and gaps that is used to outline shapes.
+ ///
public AvaloniaList StrokeDashArray
{
get { return GetValue(StrokeDashArrayProperty); }
set { SetValue(StrokeDashArrayProperty, value); }
}
+ ///
+ /// Gets or sets a value that specifies the distance within the dash pattern where a dash begins.
+ ///
public double StrokeDashOffset
{
get { return GetValue(StrokeDashOffsetProperty); }
set { SetValue(StrokeDashOffsetProperty, value); }
}
+ ///
+ /// Gets or sets the width of the shape outline.
+ ///
public double StrokeThickness
{
get { return GetValue(StrokeThicknessProperty); }
set { SetValue(StrokeThicknessProperty, value); }
}
+ ///
+ /// Gets or sets a enumeration value that describes the shape at the ends of a line.
+ ///
public PenLineCap StrokeLineCap
{
get { return GetValue(StrokeLineCapProperty); }
set { SetValue(StrokeLineCapProperty, value); }
}
+ ///
+ /// Gets or sets a enumeration value that specifies the type of join that is used at the vertices of a Shape.
+ ///
public PenLineJoin StrokeJoin
{
get { return GetValue(StrokeJoinProperty); }
@@ -170,8 +227,15 @@ namespace Avalonia.Controls.Shapes
}
}
+ ///
+ /// Creates the shape's defining geometry.
+ ///
+ /// Defining of the shape.
protected abstract Geometry CreateDefiningGeometry();
+ ///
+ /// Invalidates of this shape.
+ ///
protected void InvalidateGeometry()
{
_renderedGeometry = null;