Coder Social home page Coder Social logo

cc.circularslider.forms's Introduction

CC.CircularSlider.Forms

License []Nuget

Circle Slider Component for Xamarin.Forms.

Preview

Supported Platforms

Supported platforms are currently iOS and Android, UWP support is possible, but not in scope right now, drop an issue if you're interested in having it implemented, or open a PR, of course.

Setup

Supported platforms are currently iOS and Android, UWP support is possible, but not in scope right now, drop an issue if you're interested in having it implemented, or open a PR, of course.

Install-Package CC.CircularSlider

Usage

<?xml version="1.0" encoding="utf-8" ?>
<ContentPage
    x:Class="CircularSliderSample.MainPage"
    xmlns="http://xamarin.com/schemas/2014/forms"
    xmlns:x="http://schemas.microsoft.com/winfx/2009/xaml"
    xmlns:cc="clr-namespace:CC;assembly=CC.CircularSlider.Forms">

    <StackLayout Padding="50">
        <cc:CircularSlider
            Arc="360"
            KnobColor="{Binding Color}"
            Maximum="100"
            Minimum="0"
            OnValueChanged="CircularSlider_OnValueChanged"
            PaddingAround="10"
            Start="90"
            TrackProgressColor="{Binding Color}"
            VerticalOptions="FillAndExpand"
            Value="50" />
    </StackLayout>
</ContentPage>

And in the C#:

using System;
using Xamarin.Forms;

namespace CircularSliderSample
{
    public partial class MainPage : ContentPage
    {
        public MainPage()
        {
            InitializeComponent();
        }

        private void CircularSlider_OnValueChanged(object sender, ValueChangedEventArgs e)
        {
            Console.WriteLine(e.NewValue);
        }
    }
}

This should give you a page with a large slider embedded.

Bindable Properties/Events

Type Property Description Default Value
Property Minimum The minimum value of the slider. 0
Property Maximum The maximum value of the slider. 1
Property TrackColor The color of the background track (the back, unfilled part of the slider) Color.Gray
Property TrackProgressColor The color of the progress track (the front, filled part of the slider) Color.Red
Property KnobColor The color of the knob/handle of the slider Color.Red
Property TrackWidth The width of the background track (the back, unfilled part of the slider) 20
Property TrackProgressWidth The width of the progress track (the front, filled part of the slider) 10
Property KnobWidth The width of the knob/handle of the slider 5
Property Value The Value of the slider. 0
Property Start The Start of the slider in degrees (0 degrees is on the right side of the circle, and the angles are clockwise). 90
Property Arc How many degrees the slider should take up from the start (Max 360 - a full circle) 360
Property PaddingAround Spacing from the edges of the control. 25
Event ValueChanged Event fired when the value changes due to user interaction - same event args as the regular Xamarin.Forms Slider control.

Dependencies and special thanks

  • SkiaSharp.Views.Forms

cc.circularslider.forms's People

Contributors

iboshkov avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.