ColorEditBox Class
Represents a Color edit box.
public class ColorEditBox : PartEditBoxBase<Color?>
- Inheritance:
- object Visual UIElement FrameworkElement Control PartEditBoxBase<Color?> object
Constructors
ColorEditBox()
Initializes an instance of the class.
public ColorEditBox()
Properties
CanSwatchStretch
Indicates whether the swatch can stretch when HasText is false.
public bool CanSwatchStretch { get; set; }
Property Value
DefaultValue
The value to set when incrementing/decrementing from a null 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 color value is enabled.
public bool IsAlphaEnabled { get; set; }
Property Value
- bool:
trueif the alpha channel (transparency) of the color value is enabled; otherwise,false. The default value istrue.
Remarks
When disabled, no transparency is supported.
IsInitialValueComparedOnPopup
Indicates whether the initial color value is compared to the current value in the popup color picker.
public bool IsInitialValueComparedOnPopup { get; set; }
Property Value
- bool:
trueif the initial color value is compared to the current value in the popup color picker; otherwisefalse. The default value istrue.
SwatchBrush
The Brush that renders a sample swatch.
SwatchMargin
The Thickness of the margin around the sample swatch.
Methods
ConvertToString(Color?)
Converts the specified value to a string representation.
protected override string ConvertToString(Color? valueToConvert)
| Parameter | Type | Description |
|---|---|---|
| valueToConvert | Color? | The value. |
Returns
- string:
The string representation of the specified value.
CreateIncrementalChangeRequest(IncrementalChangeRequestKind)
Creates an incremental change (spin) request.
protected override IncrementalChangeRequest<Color?> CreateIncrementalChangeRequest(IncrementalChangeRequestKind kind)
| Parameter | Type | Description |
|---|---|---|
| kind | IncrementalChangeRequestKind | The kind of request. |
Returns
- IncrementalChangeRequest<Color?>:
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(Color?)
Tests whether the specified value is valid.
protected override bool IsValidValue(Color? value)
| Parameter | Type | Description |
|---|---|---|
| value | Color? | 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(Color?, Color?)
Invoked when the value of the IntermediateValue property changes.
protected override void OnIntermediateValueChanged(Color? oldValue, Color? newValue)
| Parameter | Type | Description |
|---|---|---|
| oldValue | Color? | The old value of the property. |
| newValue | Color? | The new value of the property. |
OnPopupOpened()
Occurs when the popup is opened.
protected override void OnPopupOpened()
Remarks
The default method implementation focuses the first popup descendant control with a tab stop.
ResetValue()
Resets the value to a default value.
protected override void ResetValue()
TryConvertFromString(string?, bool, out Color?)
Tries to convert the specified text to a value.
protected override bool TryConvertFromString(string? textToConvert, bool canCoerce, out Color? 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 | Color? | Returns the value for the specified text. |
Returns
- bool:
trueif the text was converted to a value successfully; otherwise,false.
Fields
CanSwatchStretchProperty
Defines the CanSwatchStretch property.
public static readonly DependencyProperty CanSwatchStretchProperty
DefaultValueProperty
Defines the DefaultValue property.
public static readonly DependencyProperty DefaultValueProperty
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
IsInitialValueComparedOnPopupProperty
Defines the IsInitialValueComparedOnPopup property.
public static readonly DependencyProperty IsInitialValueComparedOnPopupProperty
SwatchBrushProperty
Defines the SwatchBrush property.
public static readonly DependencyProperty SwatchBrushProperty
SwatchMarginProperty
Defines the SwatchMargin property.
public static readonly DependencyProperty SwatchMarginProperty
Inherited Members
- PartEditBoxBase<Color?>.ActivePartIndexProperty
- PartEditBoxBase<Color?>.CommitTriggersProperty
- PartEditBoxBase<Color?>.HasPopupProperty
- PartEditBoxBase<Color?>.InlinesProperty
- PartEditBoxBase<Color?>.InputScopeNameValueProperty
- PartEditBoxBase<Color?>.IntermediateValueProperty
- PartEditBoxBase<Color?>.IsArrowKeyPartNavigationEnabledProperty
- PartEditBoxBase<Color?>.IsEditableProperty
- PartEditBoxBase<Color?>.IsInputFilteringEnabledProperty
- PartEditBoxBase<Color?>.IsNonDefaultUsageContextProperty
- PartEditBoxBase<Color?>.IsNullAllowedProperty
- PartEditBoxBase<Color?>.IsPopupButtonVisibleProperty
- PartEditBoxBase<Color?>.IsPopupOpenProperty
- PartEditBoxBase<Color?>.IsReadOnlyProperty
- PartEditBoxBase<Color?>.IsSpinnerVisibleProperty
- PartEditBoxBase<Color?>.IsUndoEnabledProperty
- PartEditBoxBase<Color?>.PlaceholderTextProperty
- PartEditBoxBase<Color?>.PopupBackgroundProperty
- PartEditBoxBase<Color?>.PopupBorderBrushProperty
- PartEditBoxBase<Color?>.PopupPickerStyleProperty
- PartEditBoxBase<Color?>.SpinnerVisibilityProperty
- PartEditBoxBase<Color?>.SpinWrappingProperty
- PartEditBoxBase<Color?>.TextAlignmentProperty
- PartEditBoxBase<Color?>.UsageContextProperty
- PartEditBoxBase<Color?>.ValueProperty
- PartEditBoxBase<Color?>.CoerceValidValue(Color?)
- PartEditBoxBase<Color?>.Commit()
- PartEditBoxBase<Color?>.Commit(bool)
- PartEditBoxBase<Color?>.InvalidateParts()
- PartEditBoxBase<Color?>.OnCreateAutomationPeer()
- PartEditBoxBase<Color?>.OnGotFocus(RoutedEventArgs)
- PartEditBoxBase<Color?>.OnIsKeyboardFocusWithinChanged(DependencyPropertyChangedEventArgs)
- PartEditBoxBase<Color?>.OnIsNullAllowedChanged(bool, bool)
- PartEditBoxBase<Color?>.OnKeyDown(KeyEventArgs)
- PartEditBoxBase<Color?>.OnLostFocus(RoutedEventArgs)
- PartEditBoxBase<Color?>.OnLostMouseCapture(MouseEventArgs)
- PartEditBoxBase<Color?>.OnMouseLeftButtonDown(MouseButtonEventArgs)
- PartEditBoxBase<Color?>.OnPreviewMouseUp(MouseButtonEventArgs)
- PartEditBoxBase<Color?>.OnPreviewTextInput(TextCompositionEventArgs)
- PartEditBoxBase<Color?>.OnValueChanged(Color?, Color?)
- PartEditBoxBase<Color?>.ProcessTextInput(string)
- PartEditBoxBase<Color?>.SelectAll()
- PartEditBoxBase<Color?>.UpdateIntermediateValueAndTextFromValue()
- PartEditBoxBase<Color?>.ActivePartIndex
- PartEditBoxBase<Color?>.CommitTriggers
- PartEditBoxBase<Color?>.CurrentSelectionLength
- PartEditBoxBase<Color?>.CurrentSelectionStartOffset
- PartEditBoxBase<Color?>.CurrentText
- PartEditBoxBase<Color?>.HasPopup
- PartEditBoxBase<Color?>.Inlines
- PartEditBoxBase<Color?>.InputScopeNameValue
- PartEditBoxBase<Color?>.IntermediateValue
- PartEditBoxBase<Color?>.IsArrowKeyPartNavigationEnabled
- PartEditBoxBase<Color?>.IsEditable
- PartEditBoxBase<Color?>.IsInputFilteringEnabled
- PartEditBoxBase<Color?>.IsNonDefaultUsageContext
- PartEditBoxBase<Color?>.IsNullAllowed
- PartEditBoxBase<Color?>.IsPopupButtonVisible
- PartEditBoxBase<Color?>.IsPopupOpen
- PartEditBoxBase<Color?>.IsReadOnly
- PartEditBoxBase<Color?>.IsSpinnerVisible
- PartEditBoxBase<Color?>.IsUndoEnabled
- PartEditBoxBase<Color?>.Parts
- PartEditBoxBase<Color?>.PlaceholderText
- PartEditBoxBase<Color?>.PopupBackground
- PartEditBoxBase<Color?>.PopupBorderBrush
- PartEditBoxBase<Color?>.PopupPickerStyle
- PartEditBoxBase<Color?>.ResetValueCommand
- PartEditBoxBase<Color?>.SmallDecrementValueCommand
- PartEditBoxBase<Color?>.SmallIncrementValueCommand
- PartEditBoxBase<Color?>.SpinnerVisibility
- PartEditBoxBase<Color?>.SpinWrapping
- PartEditBoxBase<Color?>.TextAlignment
- PartEditBoxBase<Color?>.UsageContext
- PartEditBoxBase<Color?>.Value
- PartEditBoxBase<Color?>.ValueChanged