Forum Cross Platform with Xamarin

Using SignaturePad component in a Dependency Service pattern

So at the moment i am currenty trying to use SignaturePad Component in my iOS , Android projects.

1) I added the Components from the Component Store into both the projects.

2) I call via an interface in my shared project a method to open signature pad like so:

public ViewModel_AR_Signaturepad()
    {
        DependencyService.Get<ISignaturePad>().OpenSignaturePad();
    }

3) I have implemented the following in my iOS project, that is supposed to receive and handle the above call:

[assembly: Xamarin.Forms.Dependency(typeof(PCL.iOS.SignaturePad.SignaturePad_iOS))]
namespace PCL.iOS.SignaturePad
{
class SignaturePad_iOS: UIViewController, ISignaturePad
{
public void OpenSignaturePad()
{
var signature = new SignaturePadView(View.Frame);
signature.StrokeColor = UIColor.Red;
signature.SignatureLineColor = UIColor.Black;
signature.BackgroundColor = UIColor.Yellow;
this.Add(signature);

    }
}

The breakpoints get hit. I see a new instance of the SignaturePad View being created.

  • However after adding it, all i see is a blank white screen , inside my app. I cannot see the strokes or anything.
Sign In or Register to comment.