I am using SfSignaturepad to draw signatures, works well on android and iOS devices. But on windows I cannot draw the signatures. I can draw if I use mouse.
<sp:SfSignaturePad
x:Name="_sfSignaturePad"
BackgroundColor="White"
DrawCompleted="OnDrawCompleted"
MaximumStrokeThickness="5"
MinimumStrokeThickness="3"
StrokeColor="#000000" />
Is there anything that I am missing and needed for windows platform
Hi Rohit,
Thank you for reaching out to us. We have reviewed your query based on the information you provided. We have drafted a sample based on your code snippet. However, we were unable to reproduce the issue you mentioned; we were able to draw using touch in Windows without any problems.
Additionally, while reviewing your code snippet, we noticed that you are using the BackgroundColor property. We'd like to inform you that in SfSignaturePad, it's recommended to use the Background property instead to change its background.
For your reference, we have included the tested output video along with the tested sample. Please review the attachment and let us know if you have any concerns or questions. If necessary, please make any required modifications and share the updated sample with us to reproduce the issue. Additionally, please provide the details of the device specifications where you encountered the reported issue on your end which will help us to resolve the problem efficiently.
Please don’t hesitate to contact us if you have any further concerns or queries.
Regards,
Hariharan.
Ok I took a deeper dive, so basically I have an active scrollview on the page where this signature pad resides.
With an active scrollview, I am not able to draw signatures with hand. If I remove the scroll, then it works fine.
Is there any work-around for this situation. I need the page to scroll as its a form.
Hi Rohit,
Thank you for your update. We are able to reproduce the issue you mentioned regarding unable to draw signature using hand/pen when placed in a ScrollView. We are currently exploring possible workarounds to resolve the issue and will share the details with you on or before August 21, 2024. We appreciate your understanding and patience in the meantime.
Regards,
Hariharan C.
Hi Rohit,
Thank you for your patience. The issue was that whenever using the SignaturePad inside a ScrollView, the touch input was being intercepted by the ScrollView instead of the SignaturePad. To address this issue, we have provided a workaround for the Windows platform.
We have included a logic snippet for the Windows platform using the handler. Specifically, we changed the ManipulationMode interaction enum value to All, which enables all manipulation interactions in the UI without any interception.
Please refer to the attached snippet, video, and sample for more details.
|
// XAML <VerticalStackLayout> <sp:SfSignaturePad Background="White" DrawStarted="OnDrawStarted" MaximumStrokeThickness="5" MinimumStrokeThickness="3" StrokeColor="#000000" /> </VerticalStackLayout> </ScrollView>
//Code
behind private void OnDrawStarted(object sender, System.ComponentModel.CancelEventArgs e) { #if WINDOWS if (sender is SfSignaturePad signaturePad && signaturePad.Handler != null && signaturePad.Handler.PlatformView is Microsoft.UI.Xaml.Controls.UserControl sgnpad) { sgnpad.ManipulationMode = Microsoft.UI.Xaml.Input.ManipulationModes.All; } #endif } |
Please let us know
if the provided suggestion resolves your issue. If you have any further
concerns or queries, please don't hesitate to contact us.
Regards,
Hariharan C.