WinUI-Gallery icon indicating copy to clipboard operation
WinUI-Gallery copied to clipboard

Add adjustable slider properties in the slider example

Open HO-COOH opened this issue 3 years ago • 9 comments

Description

Make the example2 in Sliders Page manually adjustable.

Motivation and Context

I was tinkering with sliders in my own project and got some exceptions. Then I checked the slider examples but found the example doesn't provide manual settings for manipulating the slider properties, so I decide to add them.

How Has This Been Tested?

Manually test on the GUI.

Screenshots (if appropriate):

from this image to this image

Types of changes

  • [ ] Bug fix (non-breaking change which fixes an issue)
  • [x] New feature (non-breaking change which adds functionality)
  • [ ] Breaking change (fix or feature that would cause existing functionality to change)

HO-COOH avatar Dec 12 '21 09:12 HO-COOH

Now using ControlExample.Options. image

Indeed using binding seems simpler and it doesn't seems to throw exceptions even with exceptional inputs, like minimum greater than maximum. Would dive in more.

HO-COOH avatar Dec 13 '21 13:12 HO-COOH

Thank you @HO-COOH for implementing this! This is a great idea. Also, thank you @chingucoding for providing feedback. I'll have a deeper look at this PR later today before merging it 😄

gregwoo-microsoft avatar Dec 13 '21 18:12 gregwoo-microsoft

Thanks a lot @HO-COOH and @chingucoding! This is great. I've added the "Minimum" property to the StepFrequencyValue NumberBox to prevent crashes when set to 0. While I was looking at the slider page, I've also slightly modified the sample underneath to snap to the tick marks.

Before I merge your changes, I have a question regarding the "LargeChange" property. I can't manage to make it work on my end (clicking on the slider moves the thumb to the area where I clicked. I expected it to move by the "LargeChange" value instead). Let me know if you are experiencing the same thing or not.

gregwoo-microsoft avatar Jan 04 '22 19:01 gregwoo-microsoft

I'm also experiencing this @gregwoo-microsoft. However I'm not sure what the purpose of LargeChange is and how it is supposed to work since I didn't find any documentation on this. My guess would be that this exists for UIA purposes and make navigation that way easier.

marcelwgn avatar Jan 06 '22 18:01 marcelwgn

@chingucoding I agree that the documentation is not clear on this. I'll see what I can do to update it.

Based on what I found online (https://wpf.2000things.com/2014/03/10/1025-small-and-large-changes-to-the-value-of-a-slider/) the LargeChange property is supposed to indicate how much a slider should move when clicking on either side of the thumb. Right now when you click on either side, the thumb jumps to that location instead of being incremented by the LargeChange value.

I think that it would be best to remove the "Small Change" and "LargeChange" knobs from this PR. I am afraid that it may cause more harm than good by creating a lot of confusion. What do you think?

gregwoo-microsoft avatar Jan 06 '22 18:01 gregwoo-microsoft

I see, that makes sense, thank you for help @gregwoo-microsoft ! It kind of makes sense to remove it since it can be confusing, however on the other hand, there isn't really much left from the API if we remove the small and large change inputs.

marcelwgn avatar Jan 06 '22 18:01 marcelwgn

@stmoy what are your thoughts on this?

gregwoo-microsoft avatar Jan 06 '22 21:01 gregwoo-microsoft

this looks like a bad merge, @ho-cooh would you mind fixing taking a look? :)

marcelwgn avatar Jul 11 '22 18:07 marcelwgn

@chingucoding What's the problem?

HO-COOH avatar Jul 12 '22 10:07 HO-COOH

@gregwoo-microsoft What are your thoughts, can we merge this?

marcelwgn avatar Oct 18 '22 20:10 marcelwgn