MAUI

  • User Guide
  • Demos
  • Support
  • Forums
  • Download
Class SfSignaturePad

    Show / Hide Table of Contents

    Class SfSignaturePad

    Inheritance
    System.Object
    SfSignaturePad
    Implements
    Microsoft.Maui.IView
    Microsoft.Maui.IElement
    Microsoft.Maui.ITransform
    Namespace: Syncfusion.Maui.SignaturePad
    Assembly: Syncfusion.Maui.SignaturePad.dll
    Syntax
    public class SfSignaturePad : View, ISignaturePad, IView, IElement, ITransform

    Constructors

    SfSignaturePad()

    Initialize SignaturePad

    Declaration
    public SfSignaturePad()

    Fields

    MaximumStrokeThicknessProperty

    The backing store for the MaximumStrokeThickness field.

    Declaration
    public static readonly BindableProperty MaximumStrokeThicknessProperty
    Field Value
    Type Description
    Microsoft.Maui.Controls.BindableProperty

    MinimumStrokeThicknessProperty

    The backing store for the MinimumStrokeThickness field.

    Declaration
    public static readonly BindableProperty MinimumStrokeThicknessProperty
    Field Value
    Type Description
    Microsoft.Maui.Controls.BindableProperty

    StrokeColorProperty

    The backing store for the StrokeColor field.

    Declaration
    public static readonly BindableProperty StrokeColorProperty
    Field Value
    Type Description
    Microsoft.Maui.Controls.BindableProperty

    Properties

    MaximumStrokeThickness

    Gets or sets the minimum stroke thickness of the signature.

    Declaration
    public double MaximumStrokeThickness { get; set; }
    Property Value
    Type Description
    System.Double

    double

    Examples
    • XAML
    • C#
    <signaturePad:SfSignaturePad MaximumStrokeThickness = "5" /> 
    SfSignaturePad signaturePad = new SfSignaturePad() { MaximumStrokeThickness = 5 }; 

    MinimumStrokeThickness

    Gets or sets the maximum stroke thickness of the signature.

    Declaration
    public double MinimumStrokeThickness { get; set; }
    Property Value
    Type Description
    System.Double

    double

    Examples
    • XAML
    • C#
    <signaturePad:SfSignaturePad MinimumStrokeThickness = "1" /> 
    SfSignaturePad signaturePad = new SfSignaturePad() { MinimumStrokeThickness = 1 }; 

    StrokeColor

    Gets or sets the stroke color of the signature.

    Declaration
    public Color StrokeColor { get; set; }
    Property Value
    Type Description
    Microsoft.Maui.Graphics.Color

    Defaults to Microsoft.Maui.Graphics.Colors.Black

    Examples
    • XAML
    • C#
    <signaturePad:SfSignaturePad StrokeColor = "Red" /> 
    SfSignaturePad signaturePad = new SfSignaturePad() { StrokeColor = Colors.Red }; 

    Methods

    Clear()

    Clears the drawn signature in the SfSignaturePad.

    Declaration
    public void Clear()
    Examples
    • XAML
    • C#
    <signaturePad:SfSignaturePad x:Name="signature" /> 
    <Button Text = "Clear" Clicked="OnClearButtonClicked" />
    SfSignaturePad signature = new SfSignaturePad() 
    private void OnClearButtonClicked(object sender, EventArgs e)
    {
     signature.Clear(); 
    }

    MeasureOverride(Double, Double)

    Declaration
    protected override Size MeasureOverride(double widthConstraint, double heightConstraint)
    Parameters
    Type Name Description
    System.Double widthConstraint
    System.Double heightConstraint
    Returns
    Type Description
    Microsoft.Maui.Graphics.Size

    ToImageSource()

    Gets the drawn signature in the SfSignaturePad as an image.

    Declaration
    public ImageSource ToImageSource()
    Returns
    Type Description
    Microsoft.Maui.Controls.ImageSource
    Examples
    • XAML
    • C#
    <signaturePad:SfSignaturePad x:Name="signature" /> 
    <Button Text = "To Image" Clicked="OnSaveButtonClicked" />
    SfSignaturePad signature = new SfSignaturePad() 
    private void OnSaveButtonClicked(object sender, EventArgs e)
    {
     ImageSource? image = signature.ToImageSource();
    }

    Events

    DrawCompleted

    Occurs when the drawing is completed in the SfSignaturePad.

    Declaration
    public event EventHandler<EventArgs> DrawCompleted
    Event Type
    Type Description
    System.EventHandler<System.EventArgs>
    Examples
    • XAML
    • C#
    <signaturePad:SfSignaturePad DrawCompleted="OnDrawCompleted" /> 
    SfSignaturePad signature = new SfSignaturePad() {  DrawCompleted += OnDrawCompleted };
    private void OnDrawCompleted(object? sender, EventArgs e)
    {
    }

    DrawStarted

    Occurs when starts drawing in the SfSignaturePad.

    Declaration
    public event EventHandler<CancelEventArgs> DrawStarted
    Event Type
    Type Description
    System.EventHandler<System.ComponentModel.CancelEventArgs>
    Examples
    • XAML
    • C#
    <signaturePad:SfSignaturePad DrawStarted="OnDrawStarted" /> 
    SfSignaturePad signature = new SfSignaturePad() {  DrawStarted += OnDrawStarted };
    private void OnDrawStarted(object? sender, CancelEventArgs e)
    {
    }

    Implements

    Microsoft.Maui.IView
    Microsoft.Maui.IElement
    Microsoft.Maui.ITransform
    Back to top Generated by DocFX
    Copyright © 2001 - 2023 Syncfusion Inc. All Rights Reserved