In This Article

BrushPicker Class

Represents a Brush picker.

[TemplatePart(Name = "PART_BrushKindSelector", Type = typeof(Selector))]
[TemplatePart(Name = "PART_GradientStopSlider", Type = typeof(GradientStopSlider))]
public class BrushPicker : PickerBase
Inheritance:
object Visual UIElement FrameworkElement Control PickerBase object

Constructors

BrushPicker()

Initializes an instance of the class.

public BrushPicker()

Properties

AddGradientStopButtonToolTip

The tooltip for the add gradient stop button.

public object? AddGradientStopButtonToolTip { get; set; }

Property Value

object

BrushKind

A BrushKind indicating the kind of brush that is being edited.

public BrushKind BrushKind { get; }

Property Value

BrushKind

CanReuseBrush

Indicates whether the Brush value can simply have components like gradient stops updated instead of requiring a new brush to be created on any update.

public bool CanReuseBrush { get; set; }

Property Value

bool:

true if the Brush value can simply have components like gradient stops updated instead of requiring a new brush to be created on any update; otherwise, false. The default value is true.

Remarks

Set this to false in scenarios where ValueChanged events need to fire on any update, or when binding to Value using value converters.

IsAlphaEnabled

Indicates whether the alpha channel (transparency) of the brush value colors are enabled.

public bool IsAlphaEnabled { get; set; }

Property Value

bool:

true if the alpha channel (transparency) of the brush value colors is enabled; otherwise, false. The default value is true.

Remarks

When disabled, no transparency is supported.

IsGradient

Indicates whether the brush being edited is a GradientBrush.

public bool IsGradient { get; }

Property Value

bool:

true if the brush being edited is a GradientBrush; otherwise, false.

IsGradientAllowed

Indicates whether gradient brush values can be entered.

public bool IsGradientAllowed { get; set; }

Property Value

bool:

true if gradient brush values can be entered; otherwise, false. The default value is true.

IsNull

Indicates whether the brush being edited is a null value.

public bool IsNull { get; }

Property Value

bool:

true if the brush being edited is a null value; otherwise, false.

IsNullAllowed

Indicates whether null values are allowed to be entered by the user.

public bool IsNullAllowed { get; set; }

Property Value

bool:

true if null values are allowed to be entered by the user; otherwise false. The default value is true.

RemoveGradientStopButtonToolTip

The tooltip for the remove gradient stop button.

public object? RemoveGradientStopButtonToolTip { get; set; }

Property Value

object

ReverseGradientStopsButtonToolTip

The tooltip for the reverse gradient stops button.

public object? ReverseGradientStopsButtonToolTip { get; set; }

Property Value

object

SelectedColor

The currently selected Color.

public Color SelectedColor { get; set; }

Property Value

Color

Value

Vhe value of the control.

public Brush? Value { get; set; }

Property Value

Brush

Methods

OnApplyTemplate()

When overridden in a derived class, is invoked whenever application code or internal processes call ApplyTemplate().

public override void OnApplyTemplate()

Events

ValueChanged

Occurs after the Value property value changes.

public event EventHandler? ValueChanged

Event Type

EventHandler

Fields

AddGradientStopButtonToolTipProperty

Defines the AddGradientStopButtonToolTip property.

public static readonly DependencyProperty AddGradientStopButtonToolTipProperty

BrushKindProperty

Defines the BrushKind property.

public static readonly DependencyProperty BrushKindProperty

CanReuseBrushProperty

Defines the CanReuseBrush property.

public static readonly DependencyProperty CanReuseBrushProperty

IsAlphaEnabledProperty

Defines the IsAlphaEnabled property.

public static readonly DependencyProperty IsAlphaEnabledProperty

IsGradientAllowedProperty

Defines the IsGradientAllowed property.

public static readonly DependencyProperty IsGradientAllowedProperty

IsGradientProperty

Defines the IsGradient property.

public static readonly DependencyProperty IsGradientProperty

IsNullAllowedProperty

Defines the IsNullAllowed property.

public static readonly DependencyProperty IsNullAllowedProperty

IsNullProperty

Defines the IsNull property.

public static readonly DependencyProperty IsNullProperty

RemoveGradientStopButtonToolTipProperty

Defines the RemoveGradientStopButtonToolTip property.

public static readonly DependencyProperty RemoveGradientStopButtonToolTipProperty

ReverseGradientStopsButtonToolTipProperty

Defines the ReverseGradientStopsButtonToolTip property.

public static readonly DependencyProperty ReverseGradientStopsButtonToolTipProperty

SelectedColorProperty

Defines the SelectedColor property.

public static readonly DependencyProperty SelectedColorProperty

ValueProperty

Defines the Value property.

public static readonly DependencyProperty ValueProperty

Inherited Members

Extension Methods