Switch component for Xamarin Forms
Usage:
Namespace:
xmlns:utmdev="clr-namespace:Utmdev.Xf.Components;assembly=Utmdev.Xf.Switch"
Component:
<utmdev:Switch x:Name="xfSwitch"
VerticalOptions="CenterAndExpand"
HorizontalOptions="CenterAndExpand"
IsOn="False"
HeightRequest="50"
WidthRequest="125"
CircleColor="White"
BackgroundColor="#2FC061" />
Command:
xfSwitch.TapCommand = new Command<bool>(async (isOn) =>
{
Debug.WriteLine(isOn);
});
Demo: