Quantcast
Channel: Xamarin.Forms — Xamarin Community Forums
Viewing all articles
Browse latest Browse all 77050

How To Create Bindable TouchAction For Effect

$
0
0

SOURCE CODE:

using System;
using System.Collections.Generic;
using System.Text;
using System.Windows.Input;
using Xamarin.Forms;

namespace Test
{
public class TouchEffect : RoutingEffect
{
public event TouchActionEventHandler TouchAction;

    public TouchEffect() : base("Test.TouchEffect")
    {
    }

    public bool Capture { set; get; }

    public async void OnTouchAction(Element element, TouchActionEventArgs args)
    {
        TouchAction?.Invoke(element, args);
    }       
}

}

XAML:

<ContentPage.Effects>

</ContentPage.Effects>

effect shows TouchAction event handler how to convert it into bindable event so that we can use it like below

<ContentPage.Effects>

</ContentPage.Effects>


Viewing all articles
Browse latest Browse all 77050

Trending Articles



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