crazydev
crazydev

Reputation: 575

Validate user signature in xamarin forms

I have a signature pad designed in my XAML with the help of custom renderers. I am getting the user's signature and saving the signature as an image successfully. However, even when the user has not signed on the signature, and when I am clicking the Save button, an image is saved.

My question is how can I validate the user's signature ? How can I check if the user's has signed or not ?

The renderers that I am using is the following : https://github.com/15mgm15/Xamarin-Forms-Signature

Please help.

Upvotes: 3

Views: 1112

Answers (2)

Xiokraze
Xiokraze

Reputation: 381

Here's how I handled it with mine:

.xaml

<controls:SignaturePadView x:Name="signaturePad" CaptionText="Sign Here"/ >

.cs

if (!signaturePad.IsBlank)
{
  // Save signature image
}
else
{
  await DisplayAlert("Alert", "Please sign to confirm material check out.", "Ok");
}

Upvotes: 1

Shyju M
Shyju M

Reputation: 9943

The Signature Pad for Xamarin and Windows component is checking whether the GetStrokes ().Count == 0 or not to ensure the signature pad is not blank. Please refer the same

Github

Upvotes: 0

Related Questions