With Xamarin.RangeSlider you can pick ranges in Xamarin and Xamarin.Forms (Android, iOS, UWP, Win8 supported). Project is based on https://github.com/anothem/android-range-seek-bar (Android) and on https://github.com/muZZkat/NMRangeSlider (iOS).
You can find NuGet packages here. Version without Xamarin.Forms support is available here.
Name | Description | Remarks |
---|---|---|
LowerValue | Current lower value | Two way binding |
UpperValue | Current upper value | Two way binding |
MinimumValue | Maximum value | |
MaximumValue | Minimu value | |
MinThumbHidden | If true lower handle is hidden | |
MaxThumbHidden | If true upper handle is hidden | |
StepValue | Minimal difference between two consecutive values | |
StepValueContinuously | If false the slider will move freely with the tounch. When the touch ends, the value will snap to the nearest step value. If true the slider will stay in its current position until it reaches a new step value. | |
BarHeight | Height of the slider bar | Not supported on iOS |
ShowTextAboveThumbs | Show current values above the thumbs | |
TextSize | Text above the thumbs size | dp on Android, points on iOS, pixels on UWP |
TextFormat | Format string for text above the thumbs |
Name | Description |
---|---|
DragStarted | User started moving one of the thumbs to changenge value |
DragCompleted | Thumb has been released |
Name | Description |
---|---|
FormatLabel | Provide custom formatting for text above thumbs |
Android | iOS | UWP |
---|---|---|
Sample project.
<forms:RangeSlider x:Name="RangeSlider" MinimumValue="1" MaximumValue="100" LowerValue="1" UpperValue="100" StepValue="0" StepValueContinuously="False" VerticalOptions="Center" TextSize="15" />
public MainPage()
{
InitializeComponent();
RangeSlider.FormatLabel = FormaLabel;
}
private string FormaLabel(Thumb thumb, float val)
{
return DateTime.Today.AddDays(val).ToString("d");
}