Class SfCalculator
Represents a control for performing calculations with decimal numbers. Syncfusion.UI.Xaml.Controls.Input.SfCalculator
Inheritance
Namespace: Syncfusion.Windows.Controls.Input
Assembly: Syncfusion.SfInput.Wpf.dll
Syntax
public class SfCalculator : Control
Constructors
SfCalculator()
Initializes an instance for the Syncfusion.UI.Xaml.Controls.Input.SfCalculator control.
Declaration
public SfCalculator()
Fields
CultureProperty
Using a DependencyProperty as the backing store for Culture. This enables animation, styling, binding, etc...
Declaration
public static readonly DependencyProperty CultureProperty
Field Value
| Type |
|---|
| System.Windows.DependencyProperty |
DefaultValueProperty
Using a DependencyProperty as the backing store for Value. This enables animation, styling, binding, etc...
Declaration
public static readonly DependencyProperty DefaultValueProperty
Field Value
| Type |
|---|
| System.Windows.DependencyProperty |
DisplayTextProperty
Using a DependencyProperty as the backing store for DisplayText. This enables animation, styling, binding, etc...
Declaration
public static readonly DependencyProperty DisplayTextProperty
Field Value
| Type |
|---|
| System.Windows.DependencyProperty |
ExpressionProperty
Using a DependencyProperty as the backing store for Expression. This enables animation, styling, binding, etc...
Declaration
public static readonly DependencyProperty ExpressionProperty
Field Value
| Type |
|---|
| System.Windows.DependencyProperty |
FunctionsPaneStyleProperty
Using a DependencyProperty as the backing store for FunctionsPaneStyle. This enables animation, styling, binding, etc...
Declaration
public static readonly DependencyProperty FunctionsPaneStyleProperty
Field Value
| Type |
|---|
| System.Windows.DependencyProperty |
MemoryProperty
Using a DependencyProperty as the backing store for Memory. This enables animation, styling, binding, etc...
Declaration
public static readonly DependencyProperty MemoryProperty
Field Value
| Type |
|---|
| System.Windows.DependencyProperty |
ValueProperty
Using a DependencyProperty as the backing store for Value. This enables animation, styling, binding, etc...
Declaration
public static readonly DependencyProperty ValueProperty
Field Value
| Type |
|---|
| System.Windows.DependencyProperty |
Properties
Culture
Gets or sets the culture format for the decimal values.
Declaration
public CultureInfo Culture { get; set; }
Property Value
| Type |
|---|
| System.Globalization.CultureInfo |
DefaultValue
Gets or sets the DefaultValue of Syncfusion.UI.Xaml.Controls.Input.SfCalculator control.
Declaration
public decimal DefaultValue { get; set; }
Property Value
| Type |
|---|
| System.Decimal |
DisplayText
Gets or sets the string to be displayed.
Declaration
public string DisplayText { get; set; }
Property Value
| Type |
|---|
| System.String |
Expression
Gets or sets the string for the expression Syncfusion.UI.Xaml.Controls.Input.Expression
Declaration
public string Expression { get; set; }
Property Value
| Type |
|---|
| System.String |
FunctionsPaneStyle
Gets or sets the style for the Function Pane Syncfusion.UI.Xaml.Controls.Input.FunctionsPane
Declaration
public Style FunctionsPaneStyle { get; set; }
Property Value
| Type |
|---|
| System.Windows.Style |
Memory
Gets or sets the data to be stored in the memory.
Declaration
public decimal Memory { get; }
Property Value
| Type |
|---|
| System.Decimal |
Value
Gets or sets the Value that is calculated by the Syncfusion.UI.Xaml.Controls.Input.SfCalculator control.
Declaration
public decimal Value { get; }
Property Value
| Type |
|---|
| System.Decimal |
Methods
CheckFunction(String)
Identifies the function given as input
Declaration
public CalculatorFunctions CheckFunction(string s)
Parameters
| Type | Name | Description |
|---|---|---|
| System.String | s |
Returns
| Type |
|---|
| CalculatorFunctions |
CheckOperators()
Validates the operators in the expression.
Declaration
public void CheckOperators()
Clear()
Public method for clearing the values
Declaration
public void Clear()
ClearEntry()
public method for clear entry
Declaration
public void ClearEntry()
OnApplyTemplate()
Initializes all the child elements of Syncfusion.UI.Xaml.Controls.Input.SfCalculator control.
Declaration
public override void OnApplyTemplate()
OnCreateAutomationPeer()
Declaration
protected override AutomationPeer OnCreateAutomationPeer()
Returns
| Type |
|---|
| System.Windows.Automation.Peers.AutomationPeer |
OnKeyDown(KeyEventArgs)
Occurs when the key is pressed
Declaration
protected override void OnKeyDown(KeyEventArgs e)
Parameters
| Type | Name | Description |
|---|---|---|
| System.Windows.Input.KeyEventArgs | e |
OnKeyUp(KeyEventArgs)
Occurs when the key has been pressed
Declaration
protected override void OnKeyUp(KeyEventArgs e)
Parameters
| Type | Name | Description |
|---|---|---|
| System.Windows.Input.KeyEventArgs | e |
Reset()
Resets all the values and expression.
Declaration
public void Reset()
TrailingZeros()
Removes all the trailing zeros in the decimal value.
Declaration
public void TrailingZeros()
ValidateExpression()
Validates the expression
Declaration
public void ValidateExpression()
Events
ErrorMessageDisplayed
Invoked when an error message is displayed.
Declaration
public event SfCalculator.ErrorMessageEventHandler ErrorMessageDisplayed
Event Type
| Type |
|---|
| SfCalculator.ErrorMessageEventHandler |