Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: Align PathSegments ctor overloads to WPF PathSegmentCollection #16809

Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
30 changes: 30 additions & 0 deletions src/Avalonia.Base/Media/PathGeometryCollections.cs
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
using System.Collections.Generic;
using Avalonia.Collections;
using Avalonia.Visuals.Platform;

Expand All @@ -24,7 +25,36 @@ public static PathFigures Parse(string pathData)
}
}

/// <summary>
/// Represents a collection of <see cref="PathSegment"/> objects that can be individually accessed by index.
/// </summary>
public sealed class PathSegments : AvaloniaList<PathSegment>
{
/// <summary>
/// Initializes a new instance of the <see cref="PathSegments"/> class.
/// </summary>
public PathSegments()
{
}

/// <summary>
/// Initializes a new instance of the <see cref="PathSegments"/> class with the specified collection of <see cref="PathSegment"/> objects.
/// </summary>
/// <param name="collection">The collection of <see cref="PathSegment"/> objects that make up the <see cref="PathSegments"/>.</param>
/// <exception cref="System.ArgumentNullException"><paramref name="collection"/> is <c>null</c>.</exception>
public PathSegments(IEnumerable<PathSegment> collection) :
base(collection)
{
}

/// <summary>
/// Initializes a new instance of the PathSegments class with the specified capacity,
/// or the number of PathSegment objects the collection is initially capable of storing.
/// </summary>
/// <param name="capacity">The number of <see cref="PathSegment"/> objects that the collection is initially capable of storing.</param>
public PathSegments(int capacity) :
base(capacity)
{
}
}
}
Loading