diff --git a/src/Avalonia.Visuals/Media/Drawing.cs b/src/Avalonia.Visuals/Media/Drawing.cs
index 6bc808e407..66d05e7e48 100644
--- a/src/Avalonia.Visuals/Media/Drawing.cs
+++ b/src/Avalonia.Visuals/Media/Drawing.cs
@@ -1,11 +1,19 @@
-using Avalonia.Platform;
-
-namespace Avalonia.Media
+namespace Avalonia.Media
{
+ ///
+ /// Abstract class that describes a 2-D drawing.
+ ///
public abstract class Drawing : AvaloniaObject
{
+ ///
+ /// Draws this drawing to the given .
+ ///
+ /// The drawing context.
public abstract void Draw(DrawingContext context);
+ ///
+ /// Gets the drawing's bounding rectangle.
+ ///
public abstract Rect GetBounds();
}
}
diff --git a/src/Avalonia.Visuals/Media/GeometryDrawing.cs b/src/Avalonia.Visuals/Media/GeometryDrawing.cs
index b5052550e6..e46e3a7d5f 100644
--- a/src/Avalonia.Visuals/Media/GeometryDrawing.cs
+++ b/src/Avalonia.Visuals/Media/GeometryDrawing.cs
@@ -3,14 +3,36 @@ using Avalonia.Metadata;
namespace Avalonia.Media
{
+ ///
+ /// Represents a drawing operation that combines
+ /// a geometry with and brush and/or pen to produce rendered content.
+ ///
public class GeometryDrawing : Drawing
{
// Adding the Pen's stroke thickness here could yield wrong results due to transforms.
private static readonly IPen s_boundsPen = new ImmutablePen(Colors.Black.ToUint32(), 0);
-
+
+ ///
+ /// Defines the property.
+ ///
public static readonly StyledProperty GeometryProperty =
AvaloniaProperty.Register(nameof(Geometry));
+ ///
+ /// Defines the property.
+ ///
+ public static readonly StyledProperty BrushProperty =
+ AvaloniaProperty.Register(nameof(Brush), Brushes.Transparent);
+
+ ///
+ /// Defines the property.
+ ///
+ public static readonly StyledProperty PenProperty =
+ AvaloniaProperty.Register(nameof(Pen));
+
+ ///
+ /// Gets or sets the that describes the shape of this .
+ ///
[Content]
public Geometry Geometry
{
@@ -18,18 +40,18 @@ namespace Avalonia.Media
set => SetValue(GeometryProperty, value);
}
- public static readonly StyledProperty BrushProperty =
- AvaloniaProperty.Register(nameof(Brush), Brushes.Transparent);
-
+ ///
+ /// Gets or sets the used to fill the interior of the shape described by this .
+ ///
public IBrush Brush
{
get => GetValue(BrushProperty);
set => SetValue(BrushProperty, value);
}
- public static readonly StyledProperty PenProperty =
- AvaloniaProperty.Register(nameof(Pen));
-
+ ///
+ /// Gets or sets the used to stroke this .
+ ///
public IPen Pen
{
get => GetValue(PenProperty);
@@ -46,7 +68,7 @@ namespace Avalonia.Media
public override Rect GetBounds()
{
- return Geometry?.GetRenderBounds(s_boundsPen) ?? new Rect();
+ return Geometry?.GetRenderBounds(s_boundsPen) ?? Rect.Empty;
}
}
}