-
Notifications
You must be signed in to change notification settings - Fork 150
Bindable Strokes / Points / SignatureImage Properties #133
Comments
@TheRealSteveJudge, @VladislavAntonyuk, @MaxFe do you guys have any comments or suggestions in this area as you have opened issues. Another question for everyone, what are your use-cases so we can address them correctly? |
what is the problem? Is it in a performance of many events which calls when you set any of this properties? |
For now I do like this:
In code behind
|
Also it would be great to use command instead of events, but not necessary
|
I will definitely add commands to make life easier. |
what about points? As I see you have subscription on StrokeCompleted event where you call UpdateUI method. I think it is ok to set Points there. |
My only concern with that is if there are many points. The points and strokes are COPIED from the native side, so if there are 10K strokes, it copies that and it may take a few milliseconds. This may cause a jitter on the UI, but I never actually tested any this this may not be the case at all. |
By the way it should be a big delay on ui because user will see the points he painted before. It can be only delay with sending it to VM. Also I haven't count number of points for signature but I think it should be a lot of them |
Great, you have implemented Commands. Why you added this (https://github.com/xamarin/SignaturePad/tree/master/samples/Sample.Forms/Samples/Helpers) in Samples but not in Library? |
I want to get a release out soon, but I don't want to commit to anything with Also, this will provide a way to get some feedback without having to break anyone in the next release if there is a bug or some other issue. |
I haven't done any testing, but it may work with the older v2.x releases |
hey @mattleibow, what about the efforts to make the signature pad more mvvm capable? Are there any news on that? |
Any news about that? |
This is a larger issue to discuss the possibility for creating bindable properties for:
IEnumerable<Point> Points { get; set; }
IEnumerable<IEnumerable<Point>> Strokes { get; set; }
ImageSource SignatureImage { get; }
orStream SignatureImage { get; }
This discussion has already started in #107, #109, and #120.
The main concern is that this might be hard to do in a performant manner because the image and points update each time the stroke is in the process of drawing. This could mean that a simple line may generate thousands of events. Although, we should limit the event to only firing when the stroke is complete because the user can cancel at any time.
Already, there is a way to be notified of strokes ending by using the StrokeCompleted event - we could leverage this and then just ask for a new image each time. This is still quite heavy as if there are many strokes, the control has to first render the image or collect the points.
There may be a way to just trigger the event and not actually collect points or render images - wait until a binding requests it.
The text was updated successfully, but these errors were encountered: