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

[Enhancement] Indeterminate switch #3

Open
behroozbc opened this issue Nov 1, 2021 · 6 comments
Open

[Enhancement] Indeterminate switch #3

behroozbc opened this issue Nov 1, 2021 · 6 comments
Labels
enhancement New feature or request help wanted Extra attention is needed

Comments

@behroozbc
Copy link

hi
I want to 3 step switch like this and demo can do with Xamarin Forms Custom Switch package?

@IeuanWalker
Copy link
Owner

@behroozbc Hi, I'm open to looking at PRs but I'm unlikely to add this functionality myself.

@IeuanWalker IeuanWalker added the enhancement New feature or request label Nov 1, 2021
@behroozbc
Copy link
Author

@IeuanWalker hi
I want to help add this feature.
but I dont have any experiment to make Xamarin component Library
please help me

@IeuanWalker
Copy link
Owner

@behroozbc This probably isn't the best one to start with.

The 2 main files are -
- https://github.com/IeuanWalker/Xamarin.Forms.CustomSwitch/blob/master/Src/Switch/CustomSwitch.xaml
- https://github.com/IeuanWalker/Xamarin.Forms.CustomSwitch/blob/master/Src/Switch/CustomSwitch.xaml.cs

To support this feature IsToggled would need to be changed to allow nullable (i.e. if the null set position to the middle).

Issue i have with this is this will be a breaking change, so may be best to duplicate the current control to add this functionality.

Once IsToggled is nullable, you'll need to update the loaded event to set the position of the toggle to the middle if null

@behroozbc
Copy link
Author

Is better make new component for multi step not only 3 step like below? and fix breaking change issue.
image
all user don't want 3 step and more

@behroozbc behroozbc changed the title 3 step switch 3 and more steps switch Nov 1, 2021
@IeuanWalker
Copy link
Owner

@behroozbc That's a different type of control altogether. It's called 'Segmented control'. There is a PR in the Xamarin.CommunityToolkit that implemented it so you could just copy the code for now, or look for another package that is already released to NuGet for it.

The original idea above is called 'Indeterminate switch'. It's not very common and I haven't had a need case for it yet. So I am open to PR for that, but not the segmented control, as it isn't a switch.

@IeuanWalker IeuanWalker changed the title 3 and more steps switch [Enhancement] Indeterminate switch Nov 2, 2021
@IeuanWalker IeuanWalker added the help wanted Extra attention is needed label Nov 2, 2021
@behroozbc
Copy link
Author

@IeuanWalker Thanks

@IeuanWalker IeuanWalker transferred this issue from IeuanWalker/Xamarin.Forms.CustomSwitch Apr 5, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request help wanted Extra attention is needed
Projects
None yet
Development

No branches or pull requests

2 participants