LinearGradientColorPosition Class
Provides color and position information for a linear gradient.
[TypeConverter(typeof(LinearGradientColorPositionConverter))]
public class LinearGradientColorPosition : ICloneable
- Inheritance:
- object object
- Implements:
- ICloneable
Constructors
LinearGradientColorPosition()
Initializes an instance of the class.
public LinearGradientColorPosition()
LinearGradientColorPosition(LinearGradientColorPosition)
Initializes an instance of the class.
protected LinearGradientColorPosition(LinearGradientColorPosition copyFrom)
| Parameter | Type | Description |
|---|---|---|
| copyFrom | LinearGradientColorPosition | An instance of LinearGradientColorPosition which will be copied to initialize the new instance. |
Remarks
This constructor used in support of Clone().
LinearGradientColorPosition(Color, float)
Initializes an instance of the class.
public LinearGradientColorPosition(Color color, float position)
| Parameter | Type | Description |
|---|---|---|
| color | Color | The color of the gradient step. |
| position | float | The percentage of distance along the gradient line. |
Properties
Color
The color of the gradient step.
ColorAlpha
The color alpha value.
Position
The percentage of distance along the gradient line.
public virtual float Position { get; set; }
Property Value
- float:
This value is a decimal between 0 and 1.
Methods
Clone()
Creates a new object that is a copy of the current instance.
Equals(object?)
Determines whether the specified object is equal to the current object.
public override bool Equals(object? obj)
| Parameter | Type | Description |
|---|---|---|
| obj | object | The object to compare with the current object. |
Returns
- bool:
trueif the specified object is equal to the current object; otherwise,false.
GetHashCode()
Serves as the default hash function.
OnPropertyChanged(EventArgs)
Raises the PropertyChanged event.
protected virtual void OnPropertyChanged(EventArgs e)
| Parameter | Type | Description |
|---|---|---|
| e | EventArgs | The event data. |
ResetColor()
Resets the Color property to its default value.
public virtual void ResetColor()
ResetPosition()
Resets the Position property to its default value.
public virtual void ResetPosition()
ShouldSerializeColor()
Indicates whether the Color property should be persisted.
public virtual bool ShouldSerializeColor()
Returns
- bool:
trueif the property value has changed from its default; otherwise,false.
ShouldSerializePosition()
Indicates whether the Position property should be persisted.
public virtual bool ShouldSerializePosition()
Returns
- bool:
trueif the property value has changed from its default; otherwise,false.
Events
PropertyChanged
Occurs after a property is changed.
Inherited Members
- object.GetType()
- object.MemberwiseClone()
- object.ToString()
- object.Equals(object, object)
- object.ReferenceEquals(object, object)