Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Proposal] RangeSlider #115

Open
1 of 10 tasks
TheCodeTraveler opened this issue Sep 28, 2021 · 3 comments
Open
1 of 10 tasks

[Proposal] RangeSlider #115

TheCodeTraveler opened this issue Sep 28, 2021 · 3 comments
Assignees
Labels
approved This Proposal has been approved and is ready to be added to the Toolkit champion A member of the .NET MAUI Toolkit core team has chosen to champion this feature help wanted This proposal has been approved and is ready to be implemented pending documentation This feature requires documentation proposal A fully fleshed out proposal describing a new feature in syntactic and semantic detail

Comments

@TheCodeTraveler
Copy link
Collaborator

RangeSlider

  • Proposed
  • Prototype: Not Started
  • Implementation: Not Started
    • iOS Support
    • Android Support
    • macOS Support
    • Windows Support
  • Unit Tests: Not Started
  • Sample: Not Started
  • Documentation: Not Started

Summary

The RangeSlider control enables the user to select a range of values through a slider bar interface. As opposed to a regular Slider that lets you select a single value by sliding the thumb, this control has two thumbs that allows the user to specify a range.

Detailed Design

RangeSlider.shared.cs

public class RangeSlider : BaseTemplatedView<AbsoluteLayout>
{
  public static BindableProperty MinimumValueProperty;
  public static BindableProperty MaximumValueProperty;
  public static BindableProperty StepValueProperty;
  public static BindableProperty LowerValueProperty;
  public static BindableProperty UpperValueProperty;
  public static BindableProperty ThumbSizeProperty;
  public static BindableProperty LowerThumbSizeProperty;
  public static BindableProperty UpperThumbSizeProperty;
  public static BindableProperty TrackSizeProperty;
  public static BindableProperty ThumbColorProperty;
  public static BindableProperty LowerThumbColorProperty;
  public static BindableProperty UpperThumbColorProperty;
  public static BindableProperty TrackColorProperty;
  public static BindableProperty TrackHighlightColorProperty;
  public static BindableProperty ThumbBorderColorProperty;
  public static BindableProperty LowerThumbBorderColorProperty;
  public static BindableProperty UpperThumbBorderColorProperty;
  public static BindableProperty TrackBorderColorProperty;
  public static BindableProperty TrackHighlightBorderColorProperty;
  public static BindableProperty ValueLabelStyleProperty;
  public static BindableProperty LowerValueLabelStyleProperty;
  public static BindableProperty UpperValueLabelStyleProperty;
  public static BindableProperty ValueLabelStringFormatProperty;
  public static BindableProperty LowerThumbViewProperty;
  public static BindableProperty UpperThumbViewProperty;
  public static BindableProperty ValueLabelSpacingProperty;
  public static BindableProperty ThumbRadiusProperty;
  public static BindableProperty LowerThumbRadiusProperty;
  public static BindableProperty UpperThumbRadiusProperty;
  public static BindableProperty TrackRadiusProperty;
  
  public event EventHandler? ValueChanged;
  public event EventHandler? LowerValueChanged;
  public event EventHandler? UpperValueChanged;
  public event EventHandler? DragStarted;
  public event EventHandler? LowerDragStarted;
  public event EventHandler? UpperDragStarted;
  public event EventHandler? DragCompleted;
  public event EventHandler? LowerDragCompleted;
  public event EventHandler? UpperDragCompleted;
  
  public double MinimumValue { get; set; }
  public double MaximumValue { get; set; }
  public double StepValue { get; set; }
  public double LowerValue { get; set; }
  public double UpperValue { get; set; }
  public double ThumbSize { get; set; }
  public double LowerThumbSize { get; set; }
  public double UpperThumbSize { get; set; }
  public double TrackSize { get; set; }
  public Color ThumbColor { get; set; }
  public Color LowerThumbColor { get; set; }
  public Color UpperThumbColor { get; set; }
  public Color TrackColor { get; set; }
  public Color TrackHighlightColor { get; set; }
  public Color ThumbBorderColor { get; set; }
  public Color LowerThumbBorderColor { get; set; }
  public Color UpperThumbBorderColor { get; set; }
  public Color TrackBorderColor { get; set; }
  public Color TrackHighlightBorderColor { get; set; }
  public Style ValueLabelStyle { get; set; }
  public Style LowerValueLabelStyle { get; set; }
  public Style UpperValueLabelStyle { get; set; }
  public string ValueLabelStringFormat { get; set; }
  public View? LowerThumbView { get; set; }
  public View? UpperThumbView { get; set; }
  public double ValueLabelSpacing { get; set; }
  public double ThumbRadius { get; set; }
  public double LowerThumbRadius { get; set; }
  public double UpperThumbRadius { get; set; }
  public double TrackRadius { get; set; }
}

Usage Syntax

XAML Usage

<ContentPage xmlns="http://xamarin.com/schemas/2014/forms"
             xmlns:x="http://schemas.microsoft.com/winfx/2009/xaml"
             xmlns:xct="http://xamarin.com/schemas/2020/toolkit"
             x:Class="MyLittleApp.MainPage">

     <StackLayout>

        <xct:RangeSlider
                x:Name="RangeSlider"
                MaximumValue="10"
                MinimumValue="-10"
                StepValue="1"
                LowerValue="-10"
                UpperValue="10" />

    </StackLayout>

</ContentPage>

C# Usage

new RangeSlider
{
  MaximumValue = 10,
  MinimumValue = -10,
  StepValue = 1,
  LowerValue = -10,
  UpperValue = 10
};
@TheCodeTraveler TheCodeTraveler added new proposal A fully fleshed out proposal describing a new feature in syntactic and semantic detail labels Sep 28, 2021
@TheCodeTraveler TheCodeTraveler added this to the v1.0.0 milestone Sep 28, 2021
@TheCodeTraveler TheCodeTraveler added approved This Proposal has been approved and is ready to be added to the Toolkit champion A member of the .NET MAUI Toolkit core team has chosen to champion this feature pending documentation This feature requires documentation and removed new labels Oct 16, 2021
@TheCodeTraveler TheCodeTraveler removed this from the v1.0.0 milestone Apr 15, 2022
@bijington bijington added the help wanted This proposal has been approved and is ready to be implemented label Jun 17, 2022
@AswinPG
Copy link

AswinPG commented May 26, 2023

I have ported over the code from XCT to maui using Border instead of frame and some api changes. I don't think it's up to the coding standards you keep now. Anyways I am ready to refactor the code as needed and contribute.
https://github.com/AswinPG/RangeSliderTrial

@FlimboKan
Copy link

So is it planned to add a RangeSlider to the Community:Toolkit?

@bijington
Copy link
Contributor

The lack of activity hints that it won't be done. Would you be willing to contribute the changes?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
approved This Proposal has been approved and is ready to be added to the Toolkit champion A member of the .NET MAUI Toolkit core team has chosen to champion this feature help wanted This proposal has been approved and is ready to be implemented pending documentation This feature requires documentation proposal A fully fleshed out proposal describing a new feature in syntactic and semantic detail
Projects
None yet
Development

No branches or pull requests

5 participants