ColorEditBox Class
Represents a Color
edit box.
public class ColorEditBox : PartEditBoxBase<Color?>, DUCE.IResource, IAnimatable, IFrameworkInputElement, IInputElement, ISupportInitialize, IHaveResources, IQueryAmbient
- Inheritance:
- Object DispatcherObject DependencyObject Visual UIElement FrameworkElement Control PartEditBoxBase<Nullable<Color>> Object
Constructors
ColorEditBox()
Initializes an instance of the ColorEditBox
class.
public ColorEditBox()
Properties
DefaultValue
Gets or sets the value to set when incrementing/decrementing from a null value.
public Color DefaultValue { get; set; }
Property Value
- Color:
The value to set when incrementing/decrementing from a null value. The default value is
Red
.
HasPopupButtonWhenReadOnly
Gets whether the control should display the popup button when the control is read-only.
protected override bool HasPopupButtonWhenReadOnly { get; }
Property Value
- Boolean:
true
if the control should display the popup button when the control is read-only; otherwise,false
.
HasSwatch
Gets or sets whether the edit box should display a swatch that previews the Value
.
public bool HasSwatch { get; set; }
Property Value
- Boolean:
true
if the edit box should display a swatch that previews theValue
; otherwise,false
. The default value istrue
.
HasText
Gets or sets whether the edit box should display a text representation of the Value
.
public bool HasText { get; set; }
Property Value
- Boolean:
true
if the edit box should display a text representation of theValue
; otherwise,false
. The default value istrue
.
IsAlphaEnabled
Gets or sets whether the alpha channel (transparency) of the color value is enabled.
public bool IsAlphaEnabled { get; set; }
Property Value
- Boolean:
true
if the alpha channel (transparency) of the color value is enabled; otherwise,false
. The default value istrue
.
Remarks
When disabled, no transparency is supported.
IsInitialValueComparedOnPopup
Gets or sets a value indicating whether the initial color value is compared to the current value in the popup color picker.
public bool IsInitialValueComparedOnPopup { get; set; }
Property Value
- Boolean:
true
if the initial color value is compared to the current value in the popup color picker; otherwisefalse
. The default value istrue
.
SwatchBrush
Gets the Brush that renders a sample swatch.
SwatchMargin
Gets or sets the Thickness of the margin around the sample swatch.
public Thickness SwatchMargin { get; set; }
Property Value
Methods
ConvertToString(Nullable<Color>)
Converts the specified value to a string representation.
protected override string ConvertToString(Color? valueToConvert)
Parameter | Type | Description |
---|---|---|
valueToConvert | Nullable<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<Nullable<Color>>:
The incremental change (spin) request that was created.
GenerateParts()
Generates the parts for the edit box.
protected override IList<IPart> GenerateParts()
Returns
IsValidValue(Nullable<Color>)
Returns whether the specified value is valid.
protected override bool IsValidValue(Color? value)
Parameter | Type | Description |
---|---|---|
value | Nullable<Color> | The value to examine. |
Returns
- Boolean:
true
if the value is valid; otherwise,false
.
OnApplyTemplate()
Invoked whenever application code or internal processes call ApplyTemplate
.
public override void OnApplyTemplate()
OnIntermediateValueChanged(Nullable<Color>, Nullable<Color>)
Invoked when the value of the IntermediateValue
property changes.
protected override void OnIntermediateValueChanged(Color? oldValue, Color? newValue)
Parameter | Type | Description |
---|---|---|
oldValue | Nullable<Color> | The old value of the property. |
newValue | Nullable<Color> | The new value of the property. |
OnPopupOpened()
Occurs when the popup is opened.
protected override void OnPopupOpened()
RaiseValueChangedEvent()
Raises the ValueChanged event.
protected override void RaiseValueChangedEvent()
ResetValue()
Resets the value to a default value.
protected override void ResetValue()
TryConvertFromString(String, Boolean, out Nullable<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 | Boolean | Whether the returned value should be coerced to fall within the allowed value range. |
value | Nullable<Color> | Returns the value for the specified text. |
Returns
- Boolean:
true
if the text was converted to a value successfully; otherwise,false
.
Events
ValueChanged
Occurs after the Value
property value changes.
Fields
DefaultValueProperty
Identifies the DefaultValue dependency property. This field is read-only.
public static readonly DependencyProperty DefaultValueProperty
HasSwatchProperty
Identifies the HasSwatch dependency property. This field is read-only.
public static readonly DependencyProperty HasSwatchProperty
HasTextProperty
Identifies the HasText dependency property. This field is read-only.
public static readonly DependencyProperty HasTextProperty
IsAlphaEnabledProperty
Identifies the IsAlphaEnabled dependency property. This field is read-only.
public static readonly DependencyProperty IsAlphaEnabledProperty
IsInitialValueComparedOnPopupProperty
Identifies the IsInitialValueComparedOnPopup dependency property. This field is read-only.
public static readonly DependencyProperty IsInitialValueComparedOnPopupProperty
SwatchBrushProperty
Identifies the SwatchBrush dependency property. This field is read-only.
public static readonly DependencyProperty SwatchBrushProperty
SwatchMarginProperty
Identifies the SwatchMargin dependency property. This field is read-only.
public static readonly DependencyProperty SwatchMarginProperty
Inherited Members
- PartEditBoxBase<Nullable<Color>>.ActivePartIndexProperty
- PartEditBoxBase<Nullable<Color>>.CommitTriggersProperty
- PartEditBoxBase<Nullable<Color>>.HasPopupProperty
- PartEditBoxBase<Nullable<Color>>.InlinesProperty
- PartEditBoxBase<Nullable<Color>>.InputScopeNameValueProperty
- PartEditBoxBase<Nullable<Color>>.IntermediateValueProperty
- PartEditBoxBase<Nullable<Color>>.IsArrowKeyPartNavigationEnabledProperty
- PartEditBoxBase<Nullable<Color>>.IsEditableProperty
- PartEditBoxBase<Nullable<Color>>.IsNullAllowedProperty
- PartEditBoxBase<Nullable<Color>>.IsPopupButtonVisibleProperty
- PartEditBoxBase<Nullable<Color>>.IsPopupOpenProperty
- PartEditBoxBase<Nullable<Color>>.IsReadOnlyProperty
- PartEditBoxBase<Nullable<Color>>.IsSpinnerVisibleProperty
- PartEditBoxBase<Nullable<Color>>.IsUndoEnabledProperty
- PartEditBoxBase<Nullable<Color>>.PlaceholderTextProperty
- PartEditBoxBase<Nullable<Color>>.PopupBackgroundProperty
- PartEditBoxBase<Nullable<Color>>.PopupBorderBrushProperty
- PartEditBoxBase<Nullable<Color>>.PopupPickerStyleProperty
- PartEditBoxBase<Nullable<Color>>.SpinWrappingProperty
- PartEditBoxBase<Nullable<Color>>.TextAlignmentProperty
- PartEditBoxBase<Nullable<Color>>.ValueProperty
- PartEditBoxBase<Nullable<Color>>.IsNonDefaultUsageContextProperty
- PartEditBoxBase<Nullable<Color>>.SpinnerVisibilityProperty
- PartEditBoxBase<Nullable<Color>>.UsageContextProperty
- PartEditBoxBase<Nullable<Color>>.CoerceValidValue(Nullable<Color>)
- PartEditBoxBase<Nullable<Color>>.Commit()
- PartEditBoxBase<Nullable<Color>>.Commit(Boolean)
- PartEditBoxBase<Nullable<Color>>.InvalidateParts()
- PartEditBoxBase<Nullable<Color>>.OnCreateAutomationPeer()
- PartEditBoxBase<Nullable<Color>>.OnGotFocus(RoutedEventArgs)
- PartEditBoxBase<Nullable<Color>>.OnIsNullAllowedChanged(Boolean, Boolean)
- PartEditBoxBase<Nullable<Color>>.OnKeyDown(KeyEventArgs)
- PartEditBoxBase<Nullable<Color>>.OnLostFocus(RoutedEventArgs)
- PartEditBoxBase<Nullable<Color>>.OnValueChanged(Nullable<Color>, Nullable<Color>)
- PartEditBoxBase<Nullable<Color>>.ProcessTextInput(String)
- PartEditBoxBase<Nullable<Color>>.SelectAll()
- PartEditBoxBase<Nullable<Color>>.OnIsKeyboardFocusWithinChanged(DependencyPropertyChangedEventArgs)
- PartEditBoxBase<Nullable<Color>>.OnLostMouseCapture(MouseEventArgs)
- PartEditBoxBase<Nullable<Color>>.OnMouseLeftButtonDown(MouseButtonEventArgs)
- PartEditBoxBase<Nullable<Color>>.OnPreviewMouseUp(MouseButtonEventArgs)
- PartEditBoxBase<Nullable<Color>>.OnPreviewTextInput(TextCompositionEventArgs)
- PartEditBoxBase<Nullable<Color>>.ActivePartIndex
- PartEditBoxBase<Nullable<Color>>.CommitTriggers
- PartEditBoxBase<Nullable<Color>>.CurrentSelectionLength
- PartEditBoxBase<Nullable<Color>>.CurrentSelectionStartOffset
- PartEditBoxBase<Nullable<Color>>.CurrentText
- PartEditBoxBase<Nullable<Color>>.HasPopup
- PartEditBoxBase<Nullable<Color>>.Inlines
- PartEditBoxBase<Nullable<Color>>.InputScopeNameValue
- PartEditBoxBase<Nullable<Color>>.IntermediateValue
- PartEditBoxBase<Nullable<Color>>.IsArrowKeyPartNavigationEnabled
- PartEditBoxBase<Nullable<Color>>.IsEditable
- PartEditBoxBase<Nullable<Color>>.IsNullAllowed
- PartEditBoxBase<Nullable<Color>>.IsPopupButtonVisible
- PartEditBoxBase<Nullable<Color>>.IsPopupOpen
- PartEditBoxBase<Nullable<Color>>.IsReadOnly
- PartEditBoxBase<Nullable<Color>>.IsSpinnerVisible
- PartEditBoxBase<Nullable<Color>>.IsUndoEnabled
- PartEditBoxBase<Nullable<Color>>.Parts
- PartEditBoxBase<Nullable<Color>>.PlaceholderText
- PartEditBoxBase<Nullable<Color>>.PopupBackground
- PartEditBoxBase<Nullable<Color>>.PopupBorderBrush
- PartEditBoxBase<Nullable<Color>>.PopupPickerStyle
- PartEditBoxBase<Nullable<Color>>.ResetValueCommand
- PartEditBoxBase<Nullable<Color>>.SmallDecrementValueCommand
- PartEditBoxBase<Nullable<Color>>.SmallIncrementValueCommand
- PartEditBoxBase<Nullable<Color>>.SpinWrapping
- PartEditBoxBase<Nullable<Color>>.TextAlignment
- PartEditBoxBase<Nullable<Color>>.Value
- PartEditBoxBase<Nullable<Color>>.IsNonDefaultUsageContext
- PartEditBoxBase<Nullable<Color>>.SpinnerVisibility
- PartEditBoxBase<Nullable<Color>>.UsageContext
- Object.ToString()
- Object.Equals(Object)
- Object.Equals(Object, Object)
- Object.ReferenceEquals(Object, Object)
- Object.GetHashCode()
- Object.GetType()
- Object.MemberwiseClone()