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

[WIP] Changed the behaviour and design ot ToggleSwitch #3527

Closed
wants to merge 15 commits into from

Conversation

timunie
Copy link
Collaborator

@timunie timunie commented Jun 7, 2019

This is just the first try and not ready for use. But as my implementation will lead to a breaking change i would like to have a first feedback, if we should go this way or not.

Describe the changes you have made to improve this project

  • Added a Style for the intermediate state
  • Changed the behavior how the switch will change the state
  • Added a intermediate label property
  • changed the labels from string to object to provide more options for the labels (color, symbol, etc.)

That we need to do before we release this

  • Decide, if we need a ToggleSwitch and ToggleSwitchButton (Maybe there is a reason that i don't understand, I am not a programmer by profession, sorry for my question here)
  • Fix some issues with the click event
  • Provide more Brushes to the user to control the apperance of the different states
  • Make a new DP that indicates if the Intermediate state is allowed or not. (Maybe we can also check if the binded property is 'bool?' or 'bool'

Unit test

If it's possible then make a unit test for your changes.

Additional context

image

Closed Issues
#3276

@timunie
Copy link
Collaborator Author

timunie commented Jun 19, 2019

@punker76 May I ask you to give me a 👍 or 👎 (No need for code review or a long comment yet), just to indicate if you want me to work on this or not? Many thanks in advance.

@punker76
Copy link
Member

@timunie The ToggleSwitch uses the ToggleSwitchButton and can show a header and content. So the ToggleSwitchButton is really only the toggle button.

@timunie
Copy link
Collaborator Author

timunie commented Jun 21, 2019

@punker76 Thanks for clarification. Then we cannot drop one of tem to avoid some code twice.

@timunie timunie changed the title [WIP][RFC] Changed the behaviour and design ot ToggleSwitch [RFC] Changed the behaviour and design ot ToggleSwitch Jun 27, 2019
@timunie
Copy link
Collaborator Author

timunie commented Jun 27, 2019

Hello @punker76 ,

in my opinion this PR is ready for review. So if you have some free time, I kindly ask you to have a look at my code. 😃

Happy coding

Tim

@timunie
Copy link
Collaborator Author

timunie commented Nov 15, 2019

Hi @punker76

Should I try fix the conflicts?

Conflicting files
src/MahApps.Metro/Styles/Controls.ToggleSwitch.xaml
src/MahApps.Metro/Themes/ToggleSwitch.xaml

Happy coding
Tim

@DirkJanIT
Copy link

@timunie @punker76 Looking forward to this PR, I think it would be a welcome addition. Many other ToggleSwitches support it, such as https://documentation.devexpress.com/WPF/117154/Controls-and-Libraries/Data-Editors/Editor-Types/ToggleSwitch.

The feedback I have for this PR: everything intermediate should be called indeterminate. To keep existing stuff compatible it might be useful to revert the string > object changes.

@timunie timunie changed the title [RFC] Changed the behaviour and design ot ToggleSwitch [WIP] Changed the behaviour and design ot ToggleSwitch Nov 20, 2019
@timunie
Copy link
Collaborator Author

timunie commented Nov 20, 2019

Hi @punker76 ,
as discussed yesterday I solved the conflicts now. Unfortunatally the style is a bit broken with this change. I think it is not much work to get this done, but I want to wait until you took a look if you are happy with the new implementation or not (No need to hurry 🌪️ ).

Happy coding
Tim

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants