Offset Property

Gets the location of the gradient stop within the gradient vector.

XAML
<object Offset="Double" .../>
Scripting
value = object.Offset
object.Offset = value

Property Value

Double

The relative location of this gradient stop along the gradient vector.

This property is read/write. The default value is 0.

Remarks

The MappingMode of a LinearGradientBrush or RadialGradientBrush influences how the Offset values are interpreted. Typically you use the default MappingMode, which interprets the offsets as being a relative factor of the total area where the brush is applied. A value of 0 specifies that the stop is positioned at the beginning of the gradient vector, while a value of 1.0 specifies that the stop is positioned at the end of the gradient vector. For a LinearGradientBrush the 0 offset specifies its StartPoint. For a RadialGradientBrush the 0 offset specifies its GradientOrigin Property. This gradient stop offset factor is then mapped onto how each type of brush specifies its vector. A LinearGradientBrush vector follows a line that runs from its StartPoint to its EndPoint. A RadialGradientBrush vector radiates from its GradientOrigin towards the ellipse formed by Center, RadiusX and RadiusY.

Generally an Offset value is provided between 0 and 1.0 when using the default MappingMode. Values slightly above 1 or slightly below 0 will influence the gradient for this mode and are valid, but the same resulting gradient could be achieved entirely using values between 0 and 1 if all the gradient stops are adjusted relatively.

If you change the MappingMode to be Absolute, then the Offset is interpreted as pixels within the area where the brush is applied.

For examples and illustrations, see Silverlight Brushes Overview.

Applies To

GradientStop

See Also

Silverlight Brushes Overview