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 a new instance of the LinearGradientColorPosition class.
public LinearGradientColorPosition()
Remarks
The default constructor initializes all fields to their default values.
LinearGradientColorPosition(LinearGradientColorPosition)
Initializes a new instance of the LinearGradientColorPosition class.
protected LinearGradientColorPosition(LinearGradientColorPosition copyFrom)
| Parameter | Type | Description |
|---|---|---|
| copyFrom | LinearGradientColorPosition | An instance of |
Remarks
This constructor used in support of Clone().
LinearGradientColorPosition(Color, float)
Initializes a new instance of the LinearGradientColorPosition 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
Gets or sets the color of the gradient step.
ColorAlpha
Gets or sets the color alpha value.
Position
Gets or sets the percentage of distance along the gradient line.
public virtual float Position { get; set; }
Property Value
- float:
The percentage of distance along the gradient line. This value is a decimal between 0 and 1.
Methods
Clone()
Creates an exact duplicate of the LinearGradientColorPosition object.
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 |
Returns
- bool:
trueif the specifiedObjectis equal to the currentObject; otherwise,false.
GetHashCode()
Returns a hash code for this object.
public override int GetHashCode()
Returns
- int:
An integer value that specifies a hash value for this object.
OnPropertyChanged(EventArgs)
Raises the PropertyChanged event.
protected virtual void OnPropertyChanged(EventArgs e)
| Parameter | Type | Description |
|---|---|---|
| e | EventArgs | An |
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.