If this project help you reduce time to develop, you can give me a cup of coffee :)
This is a step slider component
Platform | Version |
---|---|
Xamarin.iOS | Not tested |
Xamarin.Android | API 14+, Not tested on lower |
Windows 10 UWP | Not tested |
https://www.nuget.org/packages/CHD.StepSlider
XAML expand
<?xml version="1.0" encoding="utf-8" ?>
<ContentPage xmlns="http://xamarin.com/schemas/2014/forms"
xmlns:x="http://schemas.microsoft.com/winfx/2009/xaml"
xmlns:local="clr-namespace:SelectorSlide"
xmlns:chd="clr-namespace:CHD;assembly=CHD.StepSlider"
x:Class="SelectorSlide.MainPage">
<StackLayout BackgroundColor="White">
<chd:StepSlider x:Name="SelectorSlideSse" Margin="15,0,15,0" VerticalOptions="CenterAndExpand"/>
</StackLayout>
</ContentPage>
CS expand
using System;
using System.Collections.Generic;
using System.Diagnostics;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using Xamarin.Forms;
namespace SelectorSlide
{
public partial class MainPage : ContentPage
{
public MainPage()
{
InitializeComponent();
SelectorSlideSse.SetOptions(new List<string>
{
"MX$20",
"MX$30",
"MX$40",
"MX$50+"
});
/*SelectorSlideSse.SetBackgroundColor(Color.Violet);
SelectorSlideSse.OptionHideColor = Color.Green;
SelectorSlideSse.OptionShowColor = Color.Red;
SelectorSlideSse.SetThumbColor(Color.Brown);
SelectorSlideSse.SetMinimumTrackColor(Color.Blue);
SelectorSlideSse.SetMaximumTrackColor(Color.DarkMagenta);
^*/
SelectorSlideSse.OnPositionChanged += (sse, pos)=>{
Debug.WriteLine("new pos = " + pos);
Debug.WriteLine("current pos = " + sse.GetPosition());
};
}
}
}