New to Telerik UI for .NET MAUI? Start a free 30-day trial

.NET MAUI SignaturePad Events

The SignaturePad for .NET MAUI exposes the following events:

  • StrokeStarted event is raised when a new stroke is started. The StrokeStarted event handler receives two parameters:

    • The Sender which is of type Telerik.Maui.Controls.RadSignaturePad.
    • and EventArgs
  • StrokeCompleted event is raised when a new stroke is completed. The StrokeCompleted event handler receives two parameters:

    • The Sender which is of type Telerik.Maui.Controls.RadSignaturePad.
    • and EventArgs
  • Cleared event is raised when the surface of Telerik.Maui.Controls.RadSignaturePad is cleared.

Example

The example contains an X Button, two Labels and a RadSignaturePad.

1. The control's definition in XAML:

<telerik:RadSignaturePad x:Name="signaturePad" BorderThickness="1" 
                         BorderColor="LightGray"
                         StrokeStarted="RadSignaturePad_StrokeStarted"
                         StrokeCompleted="RadSignaturePad_StrokeCompleted"
                         Cleared="RadSignaturePad_Cleared"/>

2. Add the following namespace:

3. 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 timestamp Label text is updated.

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 = "";
}

.NET MAUI SignaturePad Events

For the SignaturePad Events example refer to the SDKBrowser Demo Application.

See Also

In this article