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

how to set default value converter for a custom control

$
0
0

I have an enum property, SwipeDirection, which I want to be able to set like this in xaml

    <SwipeGesutreRecognizer Direction="Left">

The direciton property is

    public SwipeDirection Direction {get;set;}

I've written an IValueConverter, now the question is - how do I allow users of this control to set the direciton "left" in their xaml; but end up with the enum in the SwipeGestureRecognizer.

I thought about making my simple property a bindable property; thinkign the coerceValue delegate might be the way to go; but didn't find any docs.

I assume there must be a correct way of doing this, as this is done all over the place.

how?


Viewing all articles
Browse latest Browse all 91519

Trending Articles



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