BrushEditBox Class
Represents a Brush edit box.
public class BrushEditBox : PartEditBoxBase<Brush>
- Inheritance:
- object Visual UIElement FrameworkElement Control PartEditBoxBase<Brush> object
Constructors
BrushEditBox()
Initializes an instance of the class.
public BrushEditBox()
Properties
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:
trueif theBrushvalue 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 istrue.
Remarks
Set this to false in scenarios where ValueChanged events need to fire on any update, or when binding to Value using value converters.
CanSwatchStretch
Indicates whether the swatch can stretch when HasText is false.
public bool CanSwatchStretch { get; set; }
Property Value
HasPopupButtonWhenReadOnly
Indicates whether the control should display the popup button when the control is read-only.
protected override bool HasPopupButtonWhenReadOnly { get; }
Property Value
- bool:
trueif the control should display the popup button when the control is read-only; otherwise,false.
HasSwatch
Indicates whether the edit box should display a swatch that previews the Value.
public bool HasSwatch { get; set; }
Property Value
- bool:
trueif the edit box should display a swatch that previews theValue; otherwise,false. The default value istrue.
HasText
Indicates whether the edit box should display a text representation of the Value.
public bool HasText { get; set; }
Property Value
- bool:
trueif the edit box should display a text representation of theValue; otherwise,false. The default value istrue.
IsAlphaEnabled
Indicates whether the alpha channel (transparency) of the brush value colors are enabled.
public bool IsAlphaEnabled { get; set; }
Property Value
- bool:
trueif the alpha channel (transparency) of the brush value colors is enabled; otherwise,false. The default value istrue.
Remarks
When disabled, no transparency is supported.
IsGradientAllowed
Indicates whether gradient brush values can be entered.
public bool IsGradientAllowed { get; set; }
Property Value
- bool:
trueif gradient brush values can be entered; otherwise,false. The default value istrue.
SwatchBrush
The Brush that renders a sample swatch.
SwatchMargin
The Thickness of the margin around the sample swatch.
Methods
ConvertToString(Brush?)
Converts the specified value to a string representation.
protected override string? ConvertToString(Brush? valueToConvert)
| Parameter | Type | Description |
|---|---|---|
| valueToConvert | Brush | The value. |
Returns
- string:
The string representation of the specified value.
CreateIncrementalChangeRequest(IncrementalChangeRequestKind)
Creates an incremental change (spin) request.
protected override IncrementalChangeRequest<Brush>? CreateIncrementalChangeRequest(IncrementalChangeRequestKind kind)
| Parameter | Type | Description |
|---|---|---|
| kind | IncrementalChangeRequestKind | The kind of request. |
Returns
- IncrementalChangeRequest<Brush>:
The incremental change (spin) request that was created.
GenerateParts()
Generates the parts for the edit box.
protected override IList<IPart> GenerateParts()
Returns
IsTextInputAllowed(string)
Indicates whether the input text is allowed if text input filtering is enabled.
protected override bool IsTextInputAllowed(string text)
| Parameter | Type | Description |
|---|---|---|
| text | string | The text to examine. |
Returns
- bool:
trueif the text input is allowed; otherwise,false.
See Also
IsValidValue(Brush?)
Tests whether the specified value is valid.
protected override bool IsValidValue(Brush? value)
| Parameter | Type | Description |
|---|---|---|
| value | Brush | The value to examine. |
Returns
- bool:
trueif the value is valid; otherwise,false.
OnApplyTemplate()
When overridden in a derived class, is invoked whenever application code or internal processes call ApplyTemplate().
public override void OnApplyTemplate()
OnIntermediateValueChanged(Brush?, Brush?)
Invoked when the value of the IntermediateValue property changes.
protected override void OnIntermediateValueChanged(Brush? oldValue, Brush? newValue)
| Parameter | Type | Description |
|---|---|---|
| oldValue | Brush | The old value of the property. |
| newValue | Brush | The new value of the property. |
ResetValue()
Resets the value to a default value.
protected override void ResetValue()
TryConvertFromString(string?, bool, out Brush?)
Tries to convert the specified text to a value.
protected override bool TryConvertFromString(string? textToConvert, bool canCoerce, out Brush? value)
| Parameter | Type | Description |
|---|---|---|
| textToConvert | string | The text. |
| canCoerce | bool | Whether the returned value should be coerced to fall within the allowed value range. |
| value | Brush | Returns the value for the specified text. |
Returns
- bool:
trueif the text was converted to a value successfully; otherwise,false.
Fields
CanReuseBrushProperty
Defines the CanReuseBrush property.
public static readonly DependencyProperty CanReuseBrushProperty
CanSwatchStretchProperty
Defines the CanSwatchStretch property.
public static readonly DependencyProperty CanSwatchStretchProperty
HasSwatchProperty
Defines the HasSwatch property.
public static readonly DependencyProperty HasSwatchProperty
HasTextProperty
Defines the HasText property.
public static readonly DependencyProperty HasTextProperty
IsAlphaEnabledProperty
Defines the IsAlphaEnabled property.
public static readonly DependencyProperty IsAlphaEnabledProperty
IsGradientAllowedProperty
Defines the IsGradientAllowed property.
public static readonly DependencyProperty IsGradientAllowedProperty
SwatchBrushProperty
Defines the SwatchBrush property.
public static readonly DependencyProperty SwatchBrushProperty
SwatchMarginProperty
Defines the SwatchMargin property.
public static readonly DependencyProperty SwatchMarginProperty
Inherited Members
- PartEditBoxBase<Brush>.ActivePartIndexProperty
- PartEditBoxBase<Brush>.CommitTriggersProperty
- PartEditBoxBase<Brush>.HasPopupProperty
- PartEditBoxBase<Brush>.InlinesProperty
- PartEditBoxBase<Brush>.InputScopeNameValueProperty
- PartEditBoxBase<Brush>.IntermediateValueProperty
- PartEditBoxBase<Brush>.IsArrowKeyPartNavigationEnabledProperty
- PartEditBoxBase<Brush>.IsEditableProperty
- PartEditBoxBase<Brush>.IsInputFilteringEnabledProperty
- PartEditBoxBase<Brush>.IsNonDefaultUsageContextProperty
- PartEditBoxBase<Brush>.IsNullAllowedProperty
- PartEditBoxBase<Brush>.IsPopupButtonVisibleProperty
- PartEditBoxBase<Brush>.IsPopupOpenProperty
- PartEditBoxBase<Brush>.IsReadOnlyProperty
- PartEditBoxBase<Brush>.IsSpinnerVisibleProperty
- PartEditBoxBase<Brush>.IsUndoEnabledProperty
- PartEditBoxBase<Brush>.PlaceholderTextProperty
- PartEditBoxBase<Brush>.PopupBackgroundProperty
- PartEditBoxBase<Brush>.PopupBorderBrushProperty
- PartEditBoxBase<Brush>.PopupPickerStyleProperty
- PartEditBoxBase<Brush>.SpinnerVisibilityProperty
- PartEditBoxBase<Brush>.SpinWrappingProperty
- PartEditBoxBase<Brush>.TextAlignmentProperty
- PartEditBoxBase<Brush>.UsageContextProperty
- PartEditBoxBase<Brush>.ValueProperty
- PartEditBoxBase<Brush>.CoerceValidValue(Brush)
- PartEditBoxBase<Brush>.Commit()
- PartEditBoxBase<Brush>.Commit(bool)
- PartEditBoxBase<Brush>.InvalidateParts()
- PartEditBoxBase<Brush>.OnCreateAutomationPeer()
- PartEditBoxBase<Brush>.OnGotFocus(RoutedEventArgs)
- PartEditBoxBase<Brush>.OnIsKeyboardFocusWithinChanged(DependencyPropertyChangedEventArgs)
- PartEditBoxBase<Brush>.OnIsNullAllowedChanged(bool, bool)
- PartEditBoxBase<Brush>.OnKeyDown(KeyEventArgs)
- PartEditBoxBase<Brush>.OnLostFocus(RoutedEventArgs)
- PartEditBoxBase<Brush>.OnLostMouseCapture(MouseEventArgs)
- PartEditBoxBase<Brush>.OnMouseLeftButtonDown(MouseButtonEventArgs)
- PartEditBoxBase<Brush>.OnPopupOpened()
- PartEditBoxBase<Brush>.OnPreviewMouseUp(MouseButtonEventArgs)
- PartEditBoxBase<Brush>.OnPreviewTextInput(TextCompositionEventArgs)
- PartEditBoxBase<Brush>.OnValueChanged(Brush, Brush)
- PartEditBoxBase<Brush>.ProcessTextInput(string)
- PartEditBoxBase<Brush>.SelectAll()
- PartEditBoxBase<Brush>.UpdateIntermediateValueAndTextFromValue()
- PartEditBoxBase<Brush>.ActivePartIndex
- PartEditBoxBase<Brush>.CommitTriggers
- PartEditBoxBase<Brush>.CurrentSelectionLength
- PartEditBoxBase<Brush>.CurrentSelectionStartOffset
- PartEditBoxBase<Brush>.CurrentText
- PartEditBoxBase<Brush>.HasPopup
- PartEditBoxBase<Brush>.Inlines
- PartEditBoxBase<Brush>.InputScopeNameValue
- PartEditBoxBase<Brush>.IntermediateValue
- PartEditBoxBase<Brush>.IsArrowKeyPartNavigationEnabled
- PartEditBoxBase<Brush>.IsEditable
- PartEditBoxBase<Brush>.IsInputFilteringEnabled
- PartEditBoxBase<Brush>.IsNonDefaultUsageContext
- PartEditBoxBase<Brush>.IsNullAllowed
- PartEditBoxBase<Brush>.IsPopupButtonVisible
- PartEditBoxBase<Brush>.IsPopupOpen
- PartEditBoxBase<Brush>.IsReadOnly
- PartEditBoxBase<Brush>.IsSpinnerVisible
- PartEditBoxBase<Brush>.IsUndoEnabled
- PartEditBoxBase<Brush>.Parts
- PartEditBoxBase<Brush>.PlaceholderText
- PartEditBoxBase<Brush>.PopupBackground
- PartEditBoxBase<Brush>.PopupBorderBrush
- PartEditBoxBase<Brush>.PopupPickerStyle
- PartEditBoxBase<Brush>.ResetValueCommand
- PartEditBoxBase<Brush>.SmallDecrementValueCommand
- PartEditBoxBase<Brush>.SmallIncrementValueCommand
- PartEditBoxBase<Brush>.SpinnerVisibility
- PartEditBoxBase<Brush>.SpinWrapping
- PartEditBoxBase<Brush>.TextAlignment
- PartEditBoxBase<Brush>.UsageContext
- PartEditBoxBase<Brush>.Value
- PartEditBoxBase<Brush>.ValueChanged