Quantcast
Channel: Recent Threads — Xamarin Community Forums
Viewing all articles
Browse latest Browse all 204402

XAML: how do I call a UI element's function from another UI element?

$
0
0

I'm using xamarin forms signaturepad (a drawing pad). https://github.com/xamarin/SignaturePad/tree/master/samples
I'm editing it myself for custom functionality.

I'm trying to implement an "undo" button that removes that last stroke. I have added an Undo() function into SignaturePadCanvasView. But I don't know how to call that function.

i.e. If my xaml page looks like this

 <signaturePad:SignaturePadCanvasView
            StrokeColor="{Binding StrokeColor, Mode=TwoWay}"
            UndoCommand="{Binding ?????}"
            />

<Button Text="Undo" Command="{Binding UndoButtonCommand}"/>

<Button Text="Color" Command="{Binding ChangeColorCommand}"/>

The "Color" button is working. (ChangeColorCommand changes the "StrokeColor" property in the ViewModel).

How do I get the "Undo" button to work?


Viewing all articles
Browse latest Browse all 204402

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>