DoubleEditBox Class
Represents a Double
edit box.
public class DoubleEditBox : PartEditBoxBase<double?>, DUCE.IResource, IAnimatable, IFrameworkInputElement, IInputElement, ISupportInitialize, IHaveResources, IQueryAmbient
- Inheritance:
- System.Object System.Windows.Threading.DispatcherObject System.Windows.DependencyObject System.Windows.Media.Visual System.Windows.UIElement System.Windows.FrameworkElement System.Windows.Controls.Control PartEditBoxBase<System.Nullable<System.Double>> Object
Constructors
DoubleEditBox()
Initializes an instance of the DoubleEditBox
class.
public DoubleEditBox()
Properties
CalculatorPopupPickerStyle
Gets or sets the popup picker System.Windows.Style that uses a Calculator control.
public Style CalculatorPopupPickerStyle { get; set; }
Property Value
- System.Windows.Style:
The System.Windows.Style that uses a Calculator control.
CanSnapToChangePrecision
Gets or sets whether the value should be snapped to the precision of the incremental change value prior to applying the increment.
public bool CanSnapToChangePrecision { get; set; }
Property Value
- System.Boolean:
true
if the value should be snapped to the precision of the incremental change value prior to applying the increment; otherwise,false
. The default value istrue
.
Remarks
When true
, a value of 1.24
with change value 0.1
would result in 1.3
.
When false
, a value of 1.24
with change value 0.1
would result in 1.34
.
DefaultValue
Gets or sets the value to set when incrementing/decrementing from a null value.
public double DefaultValue { get; set; }
Property Value
- System.Double:
The value to set when incrementing/decrementing from a null value. The default value is
0
.
Format
Gets or sets the number format string.
public string Format { get; set; }
Property Value
- System.String:
The number format string. The default value is
"G"
.
IsNaNAllowed
Gets or sets whether NaN is accepted as a value.
public bool IsNaNAllowed { get; set; }
Property Value
- System.Boolean:
true
if NaN is accepted as a value; otherwise,false
. The default value isfalse
.
IsNegativeInfinityAllowed
Gets or sets whether NegativeInfinity is accepted as a value.
public bool IsNegativeInfinityAllowed { get; set; }
Property Value
- System.Boolean:
true
if NegativeInfinity is accepted as a value; otherwise,false
. The default value isfalse
.
IsPositiveInfinityAllowed
Gets or sets whether PositiveInfinity is accepted as a value.
public bool IsPositiveInfinityAllowed { get; set; }
Property Value
- System.Boolean:
true
if PositiveInfinity is accepted as a value; otherwise,false
. The default value isfalse
.
LargeChange
Gets or sets the large change value.
public double LargeChange { get; set; }
Property Value
- System.Double:
The large change value. The default value is
5.0
.
Maximum
Gets or sets the highest possible value.
public double Maximum { get; set; }
Property Value
- System.Double:
The highest possible value.
Minimum
Gets or sets the lowest possible value.
public double Minimum { get; set; }
Property Value
- System.Double:
The lowest possible value.
PickerKind
Gets or sets a DoubleEditBoxPickerKind indicating the pre-defined Style
to apply to the picker used within the popup.
public DoubleEditBoxPickerKind PickerKind { get; set; }
Property Value
- DoubleEditBoxPickerKind:
A DoubleEditBoxPickerKind indicating the pre-defined
Style
to apply to the picker used within the popup. The default value isCalculator
in WPF andDefault
in UWP.
ResolvedFormat
Gets the resolved number format string.
public string ResolvedFormat { get; }
Property Value
- System.String:
The resolved number format string.
RoundingDecimalPlace
Gets or sets the rounding decimal place.
public int? RoundingDecimalPlace { get; set; }
Property Value
- System.Nullable<System.Int32>:
The rounding decimal place, which is a value between
0
and15
. Pass a null value to disable rounding. The default value is8
.
SmallChange
Gets or sets the small change value.
public double SmallChange { get; set; }
Property Value
- System.Double:
The small change value. The default value is
1.0
.
Methods
CoerceValidValue(Nullable<Double>)
Coerces the value to be within range.
protected override double? CoerceValidValue(double? value)
Parameter | Type | Description |
---|---|---|
value | System.Nullable<System.Double> | The value to coerce. |
Returns
- System.Nullable<System.Double>:
The coerced value.
ConvertToString(Nullable<Double>)
Converts the specified value to a string representation.
protected override string ConvertToString(double? valueToConvert)
Parameter | Type | Description |
---|---|---|
valueToConvert | System.Nullable<System.Double> | The value. |
Returns
- System.String:
The string representation of the specified value.
CreateIncrementalChangeRequest(IncrementalChangeRequestKind)
Creates an incremental change (spin) request.
protected override IncrementalChangeRequest<double?> CreateIncrementalChangeRequest(IncrementalChangeRequestKind kind)
Parameter | Type | Description |
---|---|---|
kind | IncrementalChangeRequestKind | The kind of request. |
Returns
- IncrementalChangeRequest<System.Nullable<System.Double>>:
The incremental change (spin) request that was created.
GenerateParts()
Generates the parts for the edit box.
protected override IList<IPart> GenerateParts()
Returns
- System.Collections.Generic.IList<IPart>:
The parts that were generated.
IsValidValue(Nullable<Double>)
Returns whether the specified value is valid.
protected override bool IsValidValue(double? value)
Parameter | Type | Description |
---|---|---|
value | System.Nullable<System.Double> | The value to examine. |
Returns
- System.Boolean:
true
if the value is valid; otherwise,false
.
ProcessTextInput(String)
Processes typed text.
protected override bool ProcessTextInput(string text)
Parameter | Type | Description |
---|---|---|
text | System.String | The typed text. |
Returns
- System.Boolean:
true
if the typed text was handled and should not be allowed to be entered; otherwise,false
.
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<Double>)
Tries to convert the specified text to a value.
protected override bool TryConvertFromString(string textToConvert, bool canCoerce, out double? value)
Parameter | Type | Description |
---|---|---|
textToConvert | System.String | The text. |
canCoerce | System.Boolean | Whether the returned value should be coerced to fall within the allowed value range. |
value | System.Nullable<System.Double> | Returns the value for the specified text. |
Returns
- System.Boolean:
true
if the text was converted to a value successfully; otherwise,false
.
Events
ValueChanged
Occurs after the Value
property value changes.
public event EventHandler ValueChanged
Event Type
- System.EventHandler
Fields
CalculatorPopupPickerStyleProperty
Identifies the CalculatorPopupPickerStyle dependency property. This field is read-only.
public static readonly DependencyProperty CalculatorPopupPickerStyleProperty
CanSnapToChangePrecisionProperty
Identifies the CanSnapToChangePrecision dependency property. This field is read-only.
public static readonly DependencyProperty CanSnapToChangePrecisionProperty
DefaultValueProperty
Identifies the DefaultValue dependency property. This field is read-only.
public static readonly DependencyProperty DefaultValueProperty
FormatProperty
Identifies the Format dependency property. This field is read-only.
public static readonly DependencyProperty FormatProperty
IsNaNAllowedProperty
Identifies the IsNaNAllowed dependency property. This field is read-only.
public static readonly DependencyProperty IsNaNAllowedProperty
IsNegativeInfinityAllowedProperty
Identifies the IsNegativeInfinityAllowed dependency property. This field is read-only.
public static readonly DependencyProperty IsNegativeInfinityAllowedProperty
IsPositiveInfinityAllowedProperty
Identifies the IsPositiveInfinityAllowed dependency property. This field is read-only.
public static readonly DependencyProperty IsPositiveInfinityAllowedProperty
LargeChangeProperty
Identifies the LargeChange dependency property. This field is read-only.
public static readonly DependencyProperty LargeChangeProperty
MaximumProperty
Identifies the Maximum dependency property. This field is read-only.
public static readonly DependencyProperty MaximumProperty
MinimumProperty
Identifies the Minimum dependency property. This field is read-only.
public static readonly DependencyProperty MinimumProperty
PickerKindProperty
Identifies the PickerKind dependency property. This field is read-only.
public static readonly DependencyProperty PickerKindProperty
ResolvedFormatProperty
Identifies the ResolvedFormat dependency property. This field is read-only.
public static readonly DependencyProperty ResolvedFormatProperty
RoundingDecimalPlaceProperty
Identifies the RoundingDecimalPlace dependency property. This field is read-only.
public static readonly DependencyProperty RoundingDecimalPlaceProperty
SmallChangeProperty
Identifies the SmallChange dependency property. This field is read-only.
public static readonly DependencyProperty SmallChangeProperty
Inherited Members
- PartEditBoxBase<Nullable<Double>>.ActivePartIndexProperty
- PartEditBoxBase<Nullable<Double>>.CommitTriggersProperty
- PartEditBoxBase<Nullable<Double>>.HasPopupProperty
- PartEditBoxBase<Nullable<Double>>.InlinesProperty
- PartEditBoxBase<Nullable<Double>>.InputScopeNameValueProperty
- PartEditBoxBase<Nullable<Double>>.IntermediateValueProperty
- PartEditBoxBase<Nullable<Double>>.IsArrowKeyPartNavigationEnabledProperty
- PartEditBoxBase<Nullable<Double>>.IsEditableProperty
- PartEditBoxBase<Nullable<Double>>.IsNullAllowedProperty
- PartEditBoxBase<Nullable<Double>>.IsPopupButtonVisibleProperty
- PartEditBoxBase<Nullable<Double>>.IsPopupOpenProperty
- PartEditBoxBase<Nullable<Double>>.IsReadOnlyProperty
- PartEditBoxBase<Nullable<Double>>.IsSpinnerVisibleProperty
- PartEditBoxBase<Nullable<Double>>.IsUndoEnabledProperty
- PartEditBoxBase<Nullable<Double>>.PlaceholderTextProperty
- PartEditBoxBase<Nullable<Double>>.PopupBackgroundProperty
- PartEditBoxBase<Nullable<Double>>.PopupBorderBrushProperty
- PartEditBoxBase<Nullable<Double>>.PopupPickerStyleProperty
- PartEditBoxBase<Nullable<Double>>.SpinWrappingProperty
- PartEditBoxBase<Nullable<Double>>.TextAlignmentProperty
- PartEditBoxBase<Nullable<Double>>.ValueProperty
- PartEditBoxBase<Nullable<Double>>.IsNonDefaultUsageContextProperty
- PartEditBoxBase<Nullable<Double>>.SpinnerVisibilityProperty
- PartEditBoxBase<Nullable<Double>>.UsageContextProperty
- PartEditBoxBase<Nullable<Double>>.Commit()
- PartEditBoxBase<Nullable<Double>>.Commit(Boolean)
- PartEditBoxBase<Nullable<Double>>.InvalidateParts()
- PartEditBoxBase<Nullable<Double>>.OnApplyTemplate()
- PartEditBoxBase<Nullable<Double>>.OnCreateAutomationPeer()
- PartEditBoxBase<Nullable<Double>>.OnGotFocus(RoutedEventArgs)
- PartEditBoxBase<Nullable<Double>>.OnIntermediateValueChanged(Nullable<Double>, Nullable<Double>)
- PartEditBoxBase<Nullable<Double>>.OnIsNullAllowedChanged(Boolean, Boolean)
- PartEditBoxBase<Nullable<Double>>.OnKeyDown(KeyEventArgs)
- PartEditBoxBase<Nullable<Double>>.OnLostFocus(RoutedEventArgs)
- PartEditBoxBase<Nullable<Double>>.OnPopupOpened()
- PartEditBoxBase<Nullable<Double>>.OnValueChanged(Nullable<Double>, Nullable<Double>)
- PartEditBoxBase<Nullable<Double>>.SelectAll()
- PartEditBoxBase<Nullable<Double>>.UpdateIntermediateValueAndTextFromValue()
- PartEditBoxBase<Nullable<Double>>.OnIsKeyboardFocusWithinChanged(DependencyPropertyChangedEventArgs)
- PartEditBoxBase<Nullable<Double>>.OnLostMouseCapture(MouseEventArgs)
- PartEditBoxBase<Nullable<Double>>.OnMouseLeftButtonDown(MouseButtonEventArgs)
- PartEditBoxBase<Nullable<Double>>.OnPreviewMouseUp(MouseButtonEventArgs)
- PartEditBoxBase<Nullable<Double>>.OnPreviewTextInput(TextCompositionEventArgs)
- PartEditBoxBase<Nullable<Double>>.ActivePartIndex
- PartEditBoxBase<Nullable<Double>>.CommitTriggers
- PartEditBoxBase<Nullable<Double>>.CurrentSelectionLength
- PartEditBoxBase<Nullable<Double>>.CurrentSelectionStartOffset
- PartEditBoxBase<Nullable<Double>>.CurrentText
- PartEditBoxBase<Nullable<Double>>.HasPopupButtonWhenReadOnly
- PartEditBoxBase<Nullable<Double>>.HasPopup
- PartEditBoxBase<Nullable<Double>>.Inlines
- PartEditBoxBase<Nullable<Double>>.InputScopeNameValue
- PartEditBoxBase<Nullable<Double>>.IntermediateValue
- PartEditBoxBase<Nullable<Double>>.IsArrowKeyPartNavigationEnabled
- PartEditBoxBase<Nullable<Double>>.IsEditable
- PartEditBoxBase<Nullable<Double>>.IsNullAllowed
- PartEditBoxBase<Nullable<Double>>.IsPopupButtonVisible
- PartEditBoxBase<Nullable<Double>>.IsPopupOpen
- PartEditBoxBase<Nullable<Double>>.IsReadOnly
- PartEditBoxBase<Nullable<Double>>.IsSpinnerVisible
- PartEditBoxBase<Nullable<Double>>.IsUndoEnabled
- PartEditBoxBase<Nullable<Double>>.Parts
- PartEditBoxBase<Nullable<Double>>.PlaceholderText
- PartEditBoxBase<Nullable<Double>>.PopupBackground
- PartEditBoxBase<Nullable<Double>>.PopupBorderBrush
- PartEditBoxBase<Nullable<Double>>.PopupPickerStyle
- PartEditBoxBase<Nullable<Double>>.ResetValueCommand
- PartEditBoxBase<Nullable<Double>>.SmallDecrementValueCommand
- PartEditBoxBase<Nullable<Double>>.SmallIncrementValueCommand
- PartEditBoxBase<Nullable<Double>>.SpinWrapping
- PartEditBoxBase<Nullable<Double>>.TextAlignment
- PartEditBoxBase<Nullable<Double>>.Value
- PartEditBoxBase<Nullable<Double>>.IsNonDefaultUsageContext
- PartEditBoxBase<Nullable<Double>>.SpinnerVisibility
- PartEditBoxBase<Nullable<Double>>.UsageContext
- Object.ToString()
- Object.Equals(Object)
- Object.Equals(Object, Object)
- Object.ReferenceEquals(Object, Object)
- Object.GetHashCode()
- Object.GetType()
- Object.MemberwiseClone()
Extension Methods
- FrameworkElementExtensions.AnimateDoubleProperty(String, Double, Double, Double, Nullable<Double>, Nullable<Double>)
- FrameworkElementExtensions.BindToProperty(DependencyProperty, Object, String, BindingMode, IValueConverter, Object)
- FrameworkElementExtensions.BindToProperty(DependencyProperty, Object, DependencyProperty, BindingMode, IValueConverter, Object)
- FrameworkElementExtensions.GetCurrentSize()