[]
Represents a number editor control that can input a number or calculate from dropdown calculator.
[StyleTypedProperty(Property = "DropDownButtonStyle", StyleTargetType = typeof(DropDownButton))]
[StyleTypedProperty(Property = "DropDownCalculatorStyle", StyleTargetType = typeof(GcDropDownCalculator))]
[StyleTypedProperty(Property = "DropDownWindowStyle", StyleTargetType = typeof(DropDownWindow))]
[StyleTypedProperty(Property = "SpinButtonStyle", StyleTargetType = typeof(SpinButton))]
[TemplatePart(Name = "PART_Popup", Type = typeof(DropDownWindow))]
[TemplatePart(Name = "PART_DropDownChild", Type = typeof(GcDropDownCalculator))]
[TemplateVisualState(Name = "ActiveDropDown", GroupName = "ActiveStates")]
[TemplateVisualState(Name = "Negative", GroupName = "SignStates")]
[TemplateVisualState(Name = "Positive", GroupName = "SignStates")]
[TemplateVisualState(Name = "NoSign", GroupName = "SignStates")]
[TemplateVisualState(Name = "InsertState", GroupName = "EditModeStates")]
[TemplateVisualState(Name = "OverwriteState", GroupName = "EditModeStates")]
[TemplateVisualState(GroupName = "SpinButtonStates", Name = "SpinButtonCollapsed")]
[TemplateVisualState(GroupName = "SpinButtonStates", Name = "SpinButtonVisible")]
[TemplateVisualState(GroupName = "DropDownButtonStates", Name = "DropDownButtonCollapsed")]
[TemplateVisualState(GroupName = "DropDownButtonStates", Name = "DropDownButtonVisible")]
public class GcNumber : FieldsEditorControl, IAnimatable, IFrameworkInputElement, IInputElement, IQueryAmbient, IAddChild, ISupportInitialize
<StyleTypedProperty(Property:="DropDownButtonStyle", StyleTargetType:=GetType(DropDownButton))>
<StyleTypedProperty(Property:="DropDownCalculatorStyle", StyleTargetType:=GetType(GcDropDownCalculator))>
<StyleTypedProperty(Property:="DropDownWindowStyle", StyleTargetType:=GetType(DropDownWindow))>
<StyleTypedProperty(Property:="SpinButtonStyle", StyleTargetType:=GetType(SpinButton))>
<TemplatePart(Name:="PART_Popup", Type:=GetType(DropDownWindow))>
<TemplatePart(Name:="PART_DropDownChild", Type:=GetType(GcDropDownCalculator))>
<TemplateVisualState(Name:="ActiveDropDown", GroupName:="ActiveStates")>
<TemplateVisualState(Name:="Negative", GroupName:="SignStates")>
<TemplateVisualState(Name:="Positive", GroupName:="SignStates")>
<TemplateVisualState(Name:="NoSign", GroupName:="SignStates")>
<TemplateVisualState(Name:="InsertState", GroupName:="EditModeStates")>
<TemplateVisualState(Name:="OverwriteState", GroupName:="EditModeStates")>
<TemplateVisualState(GroupName:="SpinButtonStates", Name:="SpinButtonCollapsed")>
<TemplateVisualState(GroupName:="SpinButtonStates", Name:="SpinButtonVisible")>
<TemplateVisualState(GroupName:="DropDownButtonStates", Name:="DropDownButtonCollapsed")>
<TemplateVisualState(GroupName:="DropDownButtonStates", Name:="DropDownButtonVisible")>
Public Class GcNumber
Inherits FieldsEditorControl
Implements IAnimatable, IFrameworkInputElement, IInputElement, IQueryAmbient, IAddChild, ISupportInitialize
The GcNumber control provides number input for positive and negative values and allows you to design a functional numeric input interface quickly and efficiently. During data entry, the user can press the minus sign ("-") at any time to toggle the value between positive and negative. Also, the plus sign ("+") will change a negative value to positive.
GcNumber control can set its own FieldSet property an NumberFieldSet value to use different digits patterns, different sign strings and different separator char. You can use the format to limit user's input behavior. Besides, you can limit the range of value by setting the MaxValue and MinValue property.
GcNumber control support display fields. You can set a new NumberDisplayFieldSet property or change its own content. Then GcNumber can change its display text when control lost keyboard focus.
User can open the dropdown calculator to operate an calculation easily. You can define the dropdown calculaotr's view and behavior by set DropDownCalculatorStyle property.
Supported VisualState list:
VisualStateGroup Name |
VisualState Name |
Description |
---|---|---|
CommonStates |
Normal |
Represents the visual appearance when control is in normal state. |
CommonStates |
Disabled |
|
CommonStates |
ReadOnly |
Represents the visual appearance when IsReadOnly is true. | l
CommonStates |
MouseOver |
Represents the visual appearance when IsMouseOver is true. |
ActiveStates |
ActiveDropDown |
Represents the visual appearance when IsActive and IsDropDownOpen is true. |
ActiveStates |
Active |
|
ActiveStates |
Inactive |
|
InputStates |
Full |
|
InputStates |
Completed |
Represents the visual appearance when IsCompleted is true. |
InputStates |
Empty |
|
InputStates |
Part |
Represents the visual appearance when IsFull, IsCompleted and IsEmpty all are false. |
SignStates |
Negative |
Represents the visual appearance when SignState is GrapeCity.Windows.InputMan.SignState.Negative. |
SignStates |
Positive |
Represents the visual appearance when SignState is GrapeCity.Windows.InputMan.SignState.Positive. |
SignStates |
NoSign |
Represents the visual appearance when SignState return GrapeCity.Windows.InputMan.SignState.None. |
ValidationStates |
Valid |
Represents the visual appearance when System.Windows.Controls.Validation.GetHasError(System.Windows.DependencyObject) returns false. |
ValidationStates |
InvalidFocused |
Represents the visual appearance when System.Windows.Controls.Validation.GetHasError(System.Windows.DependencyObject) returns true and control has focus. |
ValidationStates |
InvalidUnfocused |
Represents the visual appearance when System.Windows.Controls.Validation.GetHasError(System.Windows.DependencyObject) returns true and control has no focus. |
Name | Description |
---|---|
GcNumber() | Initialize a new instance of the GcNumber class. |
Name | Description |
---|---|
AllowDeleteToNullProperty | Identifies the AllowDeleteToNull dependency property. |
AllowDropDownOpenProperty | Identifies the GrapeCity.Windows.InputMan.GcNumber.AllowDropDownOpen dependency property. |
AutoOpenDropDownProperty | Identifies the GrapeCity.Windows.InputMan.GcNumber.AutoOpenDropDown dependency property. |
ControlValidatorSetProperty | Identifies the GrapeCity.Windows.InputMan.GcNumber.ControlValidatorSet dependency property. |
DisplayFieldSetProperty | Identifies the GrapeCity.Windows.InputMan.GcNumber.DisplayFieldSet dependency property. |
DropDownButtonStyleProperty | Identifies the GrapeCity.Windows.InputMan.GcNumber.DropDownButtonStyle dependency property. |
DropDownButtonVisibilityProperty | Identifies the GrapeCity.Windows.InputMan.GcNumber.DropDownButtonVisibility dependency property. |
DropDownCalculatorStyleProperty | Identifies the GrapeCity.Windows.InputMan.GcNumber.DropDownCalculatorStyle dependency property. |
DropDownWindowStyleProperty | Identifies the GrapeCity.Windows.InputMan.GcNumber.DropDownWindowStyle dependency property. |
FieldSetProperty | Identifies the GrapeCity.Windows.InputMan.GcNumber.FieldSet dependency property. |
HighlightTextProperty | Identifies the GrapeCity.Windows.InputMan.GcNumber.HighlightText dependency property. |
IsDropDownOpenProperty | Identifies the GrapeCity.Windows.InputMan.GcNumber.IsDropDownOpen dependency property. |
MaxValueProperty | Identifies the GrapeCity.Windows.InputMan.GcNumber.MaxValue dependency property. |
MinValueProperty | Identifies the GrapeCity.Windows.InputMan.GcNumber.MinValue dependency property. |
NegativeForegroundProperty | Identifies the NegativeForeground dependency property. |
RecommendedValueProperty | Identifies the GrapeCity.Windows.InputMan.GcNumber.RecommendedValue dependency property. |
ShowRecommendedValueProperty | Identifies the GrapeCity.Windows.InputMan.GcNumber.ShowRecommendedValue dependency property. |
SignStateProperty | Identifies the SignState dependency property. |
SpinButtonStyleProperty | Identifies the GrapeCity.Windows.InputMan.GcNumber.SpinButtonStyle dependency property. |
SpinButtonVisibilityProperty | Identifies the GrapeCity.Windows.InputMan.GcNumber.SpinButtonVisibility dependency property. |
SpinIncrementValueProperty | Identifies the GrapeCity.Windows.InputMan.GcNumber.SpinIncrementValue dependency property. |
SpinModeProperty | Identifies the GrapeCity.Windows.InputMan.GcNumber.SpinMode dependency property. |
ValidationTriggerProperty | Identifies the GrapeCity.Windows.InputMan.GcNumber.ValidationTrigger dependency property. |
ValueChangedEvent | Identifies the ValueChanged routed event. |
ValueProperty | Identifies the GrapeCity.Windows.InputMan.GcNumber.Value dependency property. |
WatermarkDisplayZeroForegroundProperty | Identifies the GrapeCity.Windows.InputMan.GcNumber.WatermarkDisplayZeroForeground dependency property. |
WatermarkDisplayZeroProperty | Identifies the GrapeCity.Windows.InputMan.GcNumber.WatermarkDisplayZero dependency property. |
WatermarkZeroForegroundProperty | Identifies the GrapeCity.Windows.InputMan.GcNumber.WatermarkZeroForeground dependency property. |
WatermarkZeroProperty | Identifies the GrapeCity.Windows.InputMan.GcNumber.WatermarkZero dependency property. |
Name | Description |
---|---|
ActiveField | Gets the current active field of GcNumber. |
AllowDeleteToNull | Gets or set the value indicate whether value will be null or zero when all text is deleted by delete UI operation. |
AllowDropDownOpen | Gets or sets a value indicating whether allow to open drop down. |
ApplyRecommendedValueCommand | Represents the ApplyRecommendedValueCommand command, which requests that recommended value be applied. |
AutoOpenDropDown | Gets or sets a value indicating whether drop down opened automatically when control is activated. |
ControlValidatorSet | Gets or sets the a GrapeCity.Windows.InputMan.ControlValidatorSet which indicates a collection of GrapeCity.Windows.InputMan.ControlValidator. |
Decimal | Gets the decimal part value of the current Value. GcNumberValueInteger |
DisplayFieldSet | Gets or sets the GrapeCity.Windows.InputMan.Fields.NumberDisplayFieldSet of GcNumber. |
DropDownButtonStyle | Gets or sets the drop down button style which is used when dropdown button is rendered. |
DropDownButtonVisibility | Gets or sets the GrapeCity.Windows.InputMan.ButtonVisibility of the dropdown side button. This is a dependency property. |
DropDownCalculatorStyle | Gets or sets the drop down calculator style which used when dropdown calculator is rendered. |
DropDownWindowStyle | Gets or sets the drop down window style which used when dropdown window is rendered. |
FieldSet | Gets or sets GrapeCity.Windows.InputMan.Fields.NumberFieldSet value of GcNumber. |
HighlightText | Gets or sets a value indicates whether highlight text when control got focus. |
Integer | Gets the integer part value of the current number Value. GcNumberValueDecimal |
IsDropDownOpen | Gets or sets a value that indicates whether the drop-down for a GcNumber is currently open. |
MaxValue | Gets or sets a decimal value indicate the maximum of range control. |
MinValue | Gets or sets a decimal value indicate the minimum of range control. |
NegativeForeground | Gets or sets a brush indicates the foreground when Value is less than zero. |
RecommendedValue | Gets or sets the recommended value. |
SetZeroCommand | Represents the SetZeroCommand command, which requests that the current value is set to Zero. |
ShowRecommendedValue | Gets or sets a value indicating whether show the recommended value. |
SignState | Gets the sign state indicates the current value is greater or less than zero, or is null. |
SpinButtonStyle | Gets or sets the spin button style which used when spin button is rendered. |
SpinButtonVisibility | Gets or sets the GrapeCity.Windows.InputMan.ButtonVisibility of the spin side button. This is a dependency property. |
SpinIncrementValue | Gets or sets the allow spin increment value indicating spin value. |
SpinMode | Gets or sets the spin mode value indicating spin pattern. |
SwitchDropDownCommand | Represents the SwitchDropDownCommand command, which requests that the dropdown window open. |
SwitchSignCommand | Represents the SwitchSignCommand command, which requests that the value switch sign. |
ThreeZeroCommand | Represents the ThreeZeroCommand command, which requests that the current value appended with Three zeros. |
ValidationTrigger | Gets or sets a value that determines the timing of validating GrapeCity.Windows.InputMan.GcNumber.Value property. |
Value | Gets or sets the value assigned to the GcNumber control. |
ValueSign | Gets or sets the value sign of the control. |
WatermarkDisplayZero | Gets or sets the watermark text when Value is zero and GcNumber is not active. |
WatermarkDisplayZeroForeground | Gets or sets the foreground to draw WatermarkDisplayZero. |
WatermarkZero | Gets or sets the watermark text when the Value is 0. |
WatermarkZeroForeground | Gets or sets foreground to draw WatermarkZero. |
Name | Description |
---|---|
DoSpinDown(decimal) | Performs spin down. |
DoSpinUp(decimal) | Performs spin up. |
OnDropDownClosed(EventArgs) | Reports when a GcNumber's dropdown opens and raises the DropDownClosed event. |
OnDropDownOpened(EventArgs) | Reports when a GcNumber's dropdown closes and raises the DropDownOpened event. |
OnIsActiveChanged(RoutedEventArgs) | Invoked when IsActive property changed. |
OnSelectionChanged(RoutedEventArgs) | Invoked when SelectionStart or SelectionLength property changed. |
OnTextChanged(TextChangedEventArgs) | Is called when content in this editing control changed. |
OnTextChanging(TextChangingEventArgs) | Is called when content in this editing control is about to change. |
OnValueChanged(RoutedEventArgs) | Raise the ValueChanged routed event. |
OpenDropDown() | Open the drop down window of GcNumber. |
Name | Description |
---|---|
DropDownClosed | Occurs when the GrapeCity.Windows.InputMan.Primitives.DropDownWindow of a GrapeCity.Windows.InputMan.GcNumber closed. |
DropDownOpened | Occurs when the GrapeCity.Windows.InputMan.Primitives.DropDownWindow of a GrapeCity.Windows.InputMan.GcNumber opened. |
ValueChanged | Occurs when the value property changes in GrapeCity.Windows.InputMan.GcNumber. |