SignaturePad Events in Xamarin Signature (SfSignaturePad)

18 Jun 20211 minute to read

StrokeStarted

The StrokeStarted event will be triggered when drawing is started.

CancelEventArgs - SignaturePad draw start action can be restricted by setting the e.cancel to true.

<signature:SfSignaturePad  StrokeStarted="Signature_StrokeStarted">
    </signature:SfSignaturePad>
public MainPage()
     {
       InitializeComponent();
       Signature.StrokeStarted += this.Signature_StrokeStarted;
     }

     private void Signature_StrokeStarted(object sender, Syncfusion.XForms.Core.CancelEventArgs e)        
     {
            //To restrict the draw stroke, set e.Cancel to true.
               e.Cancel = true;
     }

StrokeCompleted

The StrokeCompleted event will be triggered when drawing is ended.

<signature:SfSignaturePad StrokeCompleted="Signature_StrokeCompleted">
     </signature:SfSignaturePad>
public MainPage()
     {
       InitializeComponent();
       Signature.StrokeCompleted += Signature_StrokeCompleted;
     }

     private void Signature_StrokeCompleted(object sender, EventArgs e)
     {

     }