.NET MAUI SignaturePad Events
The SignaturePad for .NET MAUI exposes the following events:
-
StrokeStarted
event is raised when a new stroke is started. TheStrokeStarted
event handler receives two parameters:- The
Sender
which is of typeTelerik.Maui.Controls.RadSignaturePad
. - and
EventArgs
- The
-
StrokeCompleted
event is raised when a new stroke is completed. TheStrokeCompleted
event handler receives two parameters:- The
Sender
which is of typeTelerik.Maui.Controls.RadSignaturePad
. - and
EventArgs
- The
Cleared
event is raised when the surface of Telerik.Maui.Controls.RadSignaturePad is cleared.
Example
The example contains a X Button, two Labels and a RadSignaturePad. The control's definition in XAML:
<telerik:RadSignaturePad x:Name="signaturePad" BorderThickness="1"
BorderColor="LightGray"
StrokeStarted="RadSignaturePad_StrokeStarted"
StrokeCompleted="RadSignaturePad_StrokeCompleted"
Cleared="RadSignaturePad_Cleared"/>
Add the following namespace:
Let's add the events:
The RadSignaturePad.StrokeStarted
event. When stroke starts we will display a timestamp using a Label:
private void RadSignaturePad_StrokeStarted(object sender, EventArgs e)
{
this.timeStampLabel.Text = DateTime.Now.ToString();
this.logInfo.Text = "";
}
The RadSignaturePad.StrokeCompleted
event. When stroke completes the timespamp Label text is udated.
private void RadSignaturePad_StrokeCompleted(object sender, EventArgs e)
{
this.timeStampLabel.Text = DateTime.Now.ToString();
}
The SignaturePad.Cleared
event, When Cleared
event is fired, Label with Text="Cleared"
is displayed.
private void RadSignaturePad_Cleared(object sender, EventArgs e)
{
this.logInfo.Text = "Cleared";
this.timeStampLabel.Text = "";
}
For the SignaturePad Events example refer to the SDKBrowser Demo Application.