-
Notifications
You must be signed in to change notification settings - Fork 37
FreakyPinCodeControl
- Description: Gets or sets the current code entered in the control.
-
Type:
string
-
Default Value:
string.Empty
-
Binding Mode:
TwoWay
- Description: Gets or sets the length of the code to be entered.
-
Type:
int
-
Default Value:
CodeView.DefaultCodeLength
-
Binding Mode:
OneWay
- Description: Gets or sets the command to be executed when code entry is completed.
-
Type:
ICommand
-
Default Value:
null
-
Binding Mode:
OneWay
- Description: Gets or sets a value indicating whether the code entry should be masked.
-
Type:
bool
-
Default Value:
true
-
Binding Mode:
OneWay
- Description: Gets or sets the color of the code entry text.
-
Type:
Color
-
Default Value:
Colors.Black
-
Binding Mode:
OneWay
- Description: Gets or sets the spacing between code entry items.
-
Type:
double
-
Default Value:
CodeView.DefaultItemSpacing
-
Binding Mode:
OneWay
- Description: Gets or sets the size of each code entry item.
-
Type:
double
-
Default Value:
CodeView.DefaultItemSize
-
Binding Mode:
OneWay
- Description: Gets or sets the shape of the code entry items.
-
Type:
ItemShape
-
Default Value:
ItemShape.Circle
-
Binding Mode:
OneWay
- Description: Gets or sets the color of the focused code entry item.
-
Type:
Color
-
Default Value:
Colors.Black
-
Binding Mode:
OneWay
- Description: Gets or sets the animation for the focused code entry item.
-
Type:
FocusAnimation
-
Default Value:
default(FocusAnimation)
-
Binding Mode:
OneWay
- Description: Gets or sets the border color of the code entry items.
-
Type:
Color
-
Default Value:
Colors.Black
-
Binding Mode:
OneWay
- Description: Gets or sets the background color of the code entry items.
-
Type:
Color
-
Default Value:
default(Color)
-
Binding Mode:
OneWay
- Description: Gets or sets the border width of the code entry items.
-
Type:
double
-
Default Value:
5.0
-
Binding Mode:
OneWay
- Description: Gets or sets the font size of the code entry text.
-
Type:
double
-
Default Value:
FreakyCodeView.FontSizeProperty.DefaultValue
-
Binding Mode:
OneWay
- Description: Gets or sets the font family of the code entry text.
-
Type:
string
- Description: Gets or sets the source of the backspace button image.
-
Type:
ImageSource
- Description: Gets or sets the background color of the numeric keypad.
-
Type:
Color
-
Default Value:
Colors.White
- Description: Gets or sets the background color of the cancel button.
-
Type:
Color
-
Default Value:
Colors.White
- Description: Gets or sets the background color of the backspace button.
-
Type:
Color
-
Default Value:
Colors.White
- Description: Gets or sets the text color of the numeric keypad buttons.
-
Type:
Color
-
Default Value:
Colors.Black
-
Description: Gets or sets the size request of the numeric keypad buttons. (Deprecated; use
KeyboardButtonHeightRequest
andKeyboardButtonWidthRequest
instead) -
Type:
double
-
Default Value:
100.0
- Description: Gets or sets the height request of the numeric keypad buttons.
-
Type:
double
- Description: Gets or sets the width request of the numeric keypad buttons.
-
Type:
double
- Description: Gets or sets the corner radius of the numeric keypad buttons.
-
Type:
int
-
Default Value:
10
- Description: Gets or sets the padding of the cancel button.
-
Type:
Thickness
-
Default Value:
new Thickness(20)
- Description: Gets or sets the text of the cancel button.
-
Type:
string
-
Default Value:
"Cancel"
- Description: Gets or sets the spacing between numeric keypad buttons.
-
Type:
double
-
Default Value:
10.0
- Description: Event raised when code entry is completed.
-
Type:
EventHandler<FreakyCodeCompletedEventArgs>
- Description: Event raised when a numeric keypad button is clicked.
-
Type:
EventHandler<FreakySelectedPinEventArgs>
- Description: Event raised when the cancel button is clicked.
-
Type:
EventHandler<EventArgs>
- Description: Event raised when the backspace button is clicked.
-
Type:
EventHandler<EventArgs>
-
The
FreakyPinCodeControl
provides a highly customizable PIN code entry experience, allowing you to configure various aspects such as appearance, behavior, and event handling. -
You can specify the number of code digits, and input type, and customize the appearance of the code entry items.
-
The control also supports events, such as
CodeEntryCompleted
, which is triggered when the user completes the code entry. -
Customize the appearance of the virtual keyboard and buttons with properties like
KeyboardBackgroundColor
,KeyboardButtonSizeRequest
, and more. -
Use event handlers like
Keyboard_Clicked
to update the code value when virtual keyboard buttons are pressed. -
The
CancelButtonPadding
property defines the padding for the cancel button (if used), providing additional customization.
// Create a FreakyPinCodeControl instance
var pinCodeControl = new FreakyPinCodeControl
{
CodeLength = 4,
CodeInputType = KeyboardType.Numeric,
CodeEntryCompletedCommand = new Command(() => HandleCodeEntryCompleted()),
BackspaceButtonSource = ImageSource.FromFile("backspace.png"),
// Customize other properties as needed
};
// Handle the CodeEntryCompleted event
pinCodeControl.CodeEntryCompleted += (sender, e) =>
{
var enteredCode = e.Code;
// Handle the completed PIN code entry
};
// Add pinCodeControl to your MAUI layout