Skip to content

This is a step slider component for Xamarin forms

Notifications You must be signed in to change notification settings

josco007/CHDStepSlider

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

8 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

CHDStepSlider

If this project help you reduce time to develop, you can give me a cup of coffee :)

paypal

This is a step slider component

Alt Text

Platform Version
Xamarin.iOS Not tested
Xamarin.Android API 14+, Not tested on lower
Windows 10 UWP Not tested

Install via nuget

https://www.nuget.org/packages/CHD.StepSlider

How to use

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

Your CS code should be like this
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());
            };

        }

    }
}

About

This is a step slider component for Xamarin forms

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages