NoesisGUI

LinearGradientBrush Class

namespace Noesis | MSDN

Paints an area with a linear gradient. A LinearGradientBrush paints an area with a linear gradient. A linear gradient defines a gradient along a line. The line's end points are defined by the StartPoint and EndPoint properties of the linear gradient. A LinearGradientBrush brush paints its GradientStops along this line.

The default linear gradient is diagonal. In the default, the StartPoint of a linear gradient is (0,0), the upper-left corner of the area being painted, and its EndPoint is (1,1), the lower-right corner of the area being painted. The colors in the resulting gradient are interpolated along the diagonal path.

It is possible to specify a gradient axis that does not completely fill area being painted. When this occurs, the SpreadMethod property determines how the remaining area is painted.

<Page xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation">
  <Rectangle Width="200" Height="100">
    <Rectangle.Fill>
      <LinearGradientBrush StartPoint="0,0" EndPoint="1,1">
        <GradientStop Color="Blue" Offset="0"/>
        <GradientStop Color="Red" Offset="1.0"/>
      </LinearGradientBrush>
    </Rectangle.Fill>
  </Rectangle>
</Page>

Inheritance Hierarchy

Brush
LinearGradientBrush

INDEX Class Hierarchy Index

Properties


Name Description
DP EndPoint Gets or sets the ending coordinates of the linear gradient
DP StartPoint Gets or sets the starting coordinates of the linear gradient

DP_ Dependency Property      RO_ Read-only


From GradientBrush


Name Description
DP ColorInterpolationMode Gets or sets a ColorInterpolationMode enumeration that specifies how the gradient's colors are interpolated.
DP GradientStops Gets or sets the brush's gradient stops
DP MappingMode Gets or sets a BrushMappingMode enumeration that specifies whether the gradient brush's positioning coordinates are absolute or relative to the output area.
DP SpreadMethod Gets or sets the type of spread method that specifies how to draw a gradient that starts or ends inside the bounds of the object to be painted.

DP_ Dependency Property      RO_ Read-only

From Brush


Name Description
DP Opacity Get/Set Opacity
DP RelativeTransform Gets or sets the transformation that is applied to the brush using relative coordinates
DP Transform Gets or sets the transformation that is applied to the brush. This transformation is applied after the brush's output has been mapped and positioned

DP_ Dependency Property      RO_ Read-only

From Freezable


Name Description
RO CanFreeze Gets a value that indicates whether the object can be made unmodifiable.
RO IsFrozen Gets a value that indicates whether the object is currently modifiable.

DP_ Dependency Property      RO_ Read-only

From DispatcherObject


Name Description
RO ThreadId Gets the thread this DispatcherObject is associated with. Returns NoThreadId when this object is not attached to any thread.

DP_ Dependency Property      RO_ Read-only

Methods

From GradientBrush

Name Description
Clone Hides Freezable methods for convenience

From Brush

Name Description
IsTransparent Indicates if this brush is transparent
TryParse Use this method to convert a Color string into a SolidColorBrush

From Freezable

Name Description
Clone Creates a modifiable clone of the Freezable, making deep copies of the object's values. When copying the object's dependency properties, this method copies expressions (which might no longer resolve) but not animations or their current values. The cloned Freezable::IsFrozen property is false even if the source's IsFrozen property is true.
CloneCurrentValue Creates a modifiable clone (deep copy) of the Freezable using its current values. The cloned object's IsFrozen property is false even if the source's IsFrozen property is true.
Freeze Makes the current object unmodifiable and sets its IsFrozen property to true.
GetAsFrozen Creates a frozen copy of the Freezable, using base (non-animated) property values. Because the copy is frozen, any frozen sub-objects are copied by reference. The copy's IsFrozen property is set to true. Throws if the Freezable cannot be frozen because it contains expressions or animated properties.
GetCurrentValueAsFrozen Creates a frozen copy of the Freezable using current property values. Because the copy is frozen, any frozen sub-objects are copied by reference. The copy's IsFrozen property is set to true.

From DependencyObject

Name Description
ClearAnimation Clears the animation value of a property
ClearAnimation Clears the animation value of a property
ClearLocalValue Clears the local value of a property The property to be cleared is specified by a DependencyProperty identifier
CoerceValue Coerces and validates the effective property value
CoerceValue Coerces and validates the effective property value
DependencyPropertyChanged Returns the PropertyChanged event
Destroyed Destroyed delegate is raised when object is going to be destroyed
GetBaseValue Returns the base value without animation nor coerce (this never returns Expression like GetLocalValue)
GetExpression Gets the expression, if any, used to evaluate the specified property value
GetLocalValue Returns the local value of a dependency property, if it exists
GetValue Returns the current effective value of a dependency property on this instance of a DependencyObject
GetValueObject Returns the current effective value of a dependency property on this instance of a DependencyObject as a boxed value
GetValueProvider Gets the provider that returns the effective value for the specified dependency property
HasAnimatedProperties Returns true if there is any animated property
InvalidateProperty Re-evaluates the effective value for the specified dependency property if necessary If null is passed, a full re-evaluation could be needed
IsCached Returns if the value is stored in the cache. If true, the priority is returned in the provider field
IsSealed Gets a value that indicates whether this instance is currently sealed (read-only)
SetAnimation Sets the animated value of a property
SetCurrentValue Sets the current value of a dependency property. The current value is set on the coerce field, without modifying source or animated value
SetCurrentValueObject Sets the current value of a dependency property using a boxed value
SetExpression Sets the expression to be evaluated dynamically to obtain the value of the property
SetValue Sets the local value of a dependency property
SetValueObject Sets the local value (boxed) of a dependency property

From DispatcherObject

Name Description
CheckAccess Determines whether the calling thread has access to this DispatcherObject
VerifyAccess Enforces that the calling thread has access to this DispatcherObject
© 2017 Noesis Technologies