Class SfCalculator
Represents a control for performing calculations with decimal numbers. SfCalculator
Inheritance
Implements
Namespace: Syncfusion.UI.Xaml.Controls.Input
Assembly: Syncfusion.SfInput.UWP.dll
Syntax
public class SfCalculator : Control, IDisposable
Constructors
SfCalculator()
Initializes an instance for the 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 |
---|
Windows.UI.Xaml.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 |
---|
Windows.UI.Xaml.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 |
---|
Windows.UI.Xaml.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 |
---|
Windows.UI.Xaml.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 |
---|
Windows.UI.Xaml.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 |
---|
Windows.UI.Xaml.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 |
---|
Windows.UI.Xaml.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 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 FunctionsPane
Declaration
public Style FunctionsPaneStyle { get; set; }
Property Value
Type |
---|
Windows.UI.Xaml.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 SfCalculator control.
Declaration
public Decimal Value { get; }
Property Value
Type |
---|
System.Decimal |
Methods
add_ErrorMessageDisplayed(SfCalculator.ErrorMessageEventHandler)
Declaration
public void add_ErrorMessageDisplayed(SfCalculator.ErrorMessageEventHandler value)
Parameters
Type | Name | Description |
---|---|---|
SfCalculator.ErrorMessageEventHandler | value |
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()
Dispose()
Declaration
public void Dispose()
OnApplyTemplate()
Initializes all the child elements of SfCalculator control.
Declaration
protected override void OnApplyTemplate()
OnKeyDown(KeyRoutedEventArgs)
Occurs when the key is pressed
Declaration
protected override void OnKeyDown(KeyRoutedEventArgs e)
Parameters
Type | Name | Description |
---|---|---|
Windows.UI.Xaml.Input.KeyRoutedEventArgs | e |
OnKeyUp(KeyRoutedEventArgs)
Occurs when the key has been pressed
Declaration
protected override void OnKeyUp(KeyRoutedEventArgs e)
Parameters
Type | Name | Description |
---|---|---|
Windows.UI.Xaml.Input.KeyRoutedEventArgs | e |
remove_ErrorMessageDisplayed(SfCalculator.ErrorMessageEventHandler)
Declaration
public void remove_ErrorMessageDisplayed(SfCalculator.ErrorMessageEventHandler value)
Parameters
Type | Name | Description |
---|---|---|
SfCalculator.ErrorMessageEventHandler | value |
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 |