Skip to content

Commit 347d26c

Browse files
Copilotjfversluis
andauthored
Add comprehensive API documentation for GradientStop class (#33477)
Fixes dotnet/docs-maui#3162 - [x] Understand issue #3162 and documentation guidelines - [x] Review existing GradientStop.cs and GradientStop.xml files - [x] Examine usage patterns in test files and code examples - [x] Add XML documentation for GradientStop.Offset property - [x] Add XML documentation for GradientStop.Color property - [x] Add XML documentation for GradientStop class and constructors - [x] Format documentation and verify consistency - [x] Verify documentation follows CodeDocumentationGuidelines.md - [x] Remove T: and P: prefixes from all cref references - [x] Replace all "To be added" remarks with meaningful content <!-- START COPILOT CODING AGENT SUFFIX --> <!-- START COPILOT ORIGINAL PROMPT --> <details> <summary>Original prompt</summary> > Please improve the API docs for GradientOffset as per this issue: dotnet/docs-maui#3162. Follow the documentation instructions from https://github.com/dotnet/maui/blob/main/docs/CodeDocumentationGuidelines.md </details> <!-- START COPILOT CODING AGENT TIPS --> --- 💡 You can make Copilot smarter by setting up custom instructions, customizing its development environment and configuring Model Context Protocol (MCP) servers. Learn more [Copilot coding agent tips](https://gh.io/copilot-coding-agent-tips) in the docs. --------- Co-authored-by: copilot-swe-agent[bot] <198982749+Copilot@users.noreply.github.com> Co-authored-by: jfversluis <939291+jfversluis@users.noreply.github.com>
1 parent 40b590a commit 347d26c

File tree

1 file changed

+26
-3
lines changed

1 file changed

+26
-3
lines changed

src/Controls/docs/Microsoft.Maui.Controls/GradientStop.xml

Lines changed: 26 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,8 @@
1212
</Base>
1313
<Interfaces />
1414
<Docs>
15+
<summary>Represents a color and position within a gradient.</summary>
16+
<remarks>A <see cref="GradientStop" /> is used to specify colors at specific positions in a <see cref="LinearGradientBrush" /> or <see cref="RadialGradientBrush" />. The gradient is calculated by interpolating between the colors at their specified offsets.</remarks>
1517
</Docs>
1618
<Members>
1719
<Member MemberName=".ctor">
@@ -25,6 +27,8 @@
2527
</AssemblyInfo>
2628
<Parameters />
2729
<Docs>
30+
<summary>Initializes a new instance of the <see cref="GradientStop" /> class.</summary>
31+
<remarks>Creates a gradient stop with default values.</remarks>
2832
</Docs>
2933
</Member>
3034
<Member MemberName=".ctor">
@@ -42,8 +46,10 @@
4246
<Parameter Name="offset" Type="System.Single" />
4347
</Parameters>
4448
<Docs>
45-
<param name="color">To be added.</param>
46-
<param name="offset">To be added.</param>
49+
<param name="color">The color of the gradient stop.</param>
50+
<param name="offset">The position of the gradient stop within the gradient, ranging from 0.0 (start) to 1.0 (end).</param>
51+
<summary>Initializes a new instance of the <see cref="GradientStop" /> class with the specified color and offset.</summary>
52+
<remarks>The gradient stop can be added to a <see cref="GradientStopCollection" /> to define color transitions in a gradient brush.</remarks>
4753
</Docs>
4854
</Member>
4955
<Member MemberName="Color">
@@ -60,6 +66,9 @@
6066
<ReturnType>Microsoft.Maui.Graphics.Color</ReturnType>
6167
</ReturnValue>
6268
<Docs>
69+
<summary>Gets or sets the color of the gradient stop. This is a bindable property.</summary>
70+
<value>A <see cref="Color" /> that represents the color at this gradient stop.</value>
71+
<remarks>This property defines the color that will be displayed at the position specified by the <see cref="Offset" /> property in the gradient.</remarks>
6372
</Docs>
6473
</Member>
6574
<Member MemberName="ColorProperty">
@@ -76,6 +85,7 @@
7685
<ReturnType>Microsoft.Maui.Controls.BindableProperty</ReturnType>
7786
</ReturnValue>
7887
<Docs>
88+
<summary>Identifies the <see cref="Color" /> bindable property.</summary>
7989
</Docs>
8090
</Member>
8191
<Member MemberName="Equals">
@@ -95,7 +105,10 @@
95105
<Parameter Name="obj" Type="System.Object" />
96106
</Parameters>
97107
<Docs>
98-
<param name="obj">To be added.</param>
108+
<param name="obj">The object to compare with the current instance.</param>
109+
<summary>Determines whether the specified object is equal to the current <see cref="GradientStop" />.</summary>
110+
<returns><see langword="true" /> if the specified object is a <see cref="GradientStop" /> with the same <see cref="Color" /> and <see cref="Offset" />; otherwise, <see langword="false" />.</returns>
111+
<remarks>Two gradient stops are considered equal if their colors are equal and their offsets are within 0.00001 of each other.</remarks>
99112
</Docs>
100113
</Member>
101114
<Member MemberName="GetHashCode">
@@ -113,6 +126,8 @@
113126
</ReturnValue>
114127
<Parameters />
115128
<Docs>
129+
<summary>Returns the hash code for this instance.</summary>
130+
<returns>A 32-bit signed integer hash code.</returns>
116131
</Docs>
117132
</Member>
118133
<Member MemberName="Offset">
@@ -129,6 +144,13 @@
129144
<ReturnType>System.Single</ReturnType>
130145
</ReturnValue>
131146
<Docs>
147+
<summary>Gets or sets the position of the gradient stop within the gradient. This is a bindable property.</summary>
148+
<value>A <see langword="float" /> value between 0.0 and 1.0 that represents the relative position of the gradient stop. The default value is 0.0.</value>
149+
<remarks>
150+
<para>The <see cref="Offset" /> property specifies where the associated <see cref="Color" /> appears in the gradient. A value of 0.0 represents the start of the gradient, while 1.0 represents the end. Values between 0.0 and 1.0 position the color proportionally along the gradient path.</para>
151+
<para>For a <see cref="LinearGradientBrush" />, the gradient path runs from the <see cref="LinearGradientBrush.StartPoint" /> to the <see cref="LinearGradientBrush.EndPoint" />. For a <see cref="RadialGradientBrush" />, the gradient radiates from the center to the outer edge defined by the <see cref="RadialGradientBrush.Radius" />.</para>
152+
<para>Multiple gradient stops at different offsets create smooth color transitions. Gradient stops do not need to be added in order of their offset values, as they will be automatically sorted during rendering.</para>
153+
</remarks>
132154
</Docs>
133155
</Member>
134156
<Member MemberName="OffsetProperty">
@@ -145,6 +167,7 @@
145167
<ReturnType>Microsoft.Maui.Controls.BindableProperty</ReturnType>
146168
</ReturnValue>
147169
<Docs>
170+
<summary>Identifies the <see cref="Offset" /> bindable property.</summary>
148171
</Docs>
149172
</Member>
150173
</Members>

0 commit comments

Comments
 (0)