microsoft / microsoft-ui-xaml

Windows UI Library: the latest Windows 10 native controls and Fluent styles for your applications
MIT License
6.34k stars 676 forks source link

RadioButtons Style Improvements [Issue Collection] #3759

Open michael-hawker opened 3 years ago

michael-hawker commented 3 years ago

Describe the bug I was trying to see if the RadioButtons control could be re-styled to support the Segmented Control scenario (#2310) as asked by @sonnemaf here on Twitter: https://twitter.com/fonssonnemans/status/1334606237820985345

I was able to get close from a style perspective (haven't tried functionality in terms of SelectedItem):

image

But trying to re-style RadioButtons as painful due to the following set of issues:

Linked Issues

TO DO Should test out how re-styling works with selection to see if further issues need to be collected here. I was able to just set SelectedIndex on the RadioButtons and it seemed to surprisingly set the ToggleButton state, so maybe there's not much to do here?

Have my test work in a gist here: https://gist.github.com/michael-hawker/06bda503efa14fbb2a84896643c21959

StephenLPeters commented 3 years ago

This is awesome! retemplating is great when it works. hopefully we can resolve these styling issues.

sonnemaf commented 3 years ago

I want the RadioButtons to have animations, see my mock-up video https://twitter.com/fonssonnemans/status/1334816598599880705

image

StephenLPeters commented 3 years ago

I think its probably difficult to get this style of animation with a simple retemplate of RadioButtons... You might be able to do it with a new VSM group and calling go to state yourself in the checked/unchecked handlers of retemplated toggle switches you put as children of the RadioButtons. Seems tricky but maybe possible.

niels9001 commented 1 year ago

We have recently published the new Segmented control and TokenView controls as part of the Windows Community Toolkit Labs. I think these controls are very much in line what is discussed here.

Segmented control

More info here: https://github.com/CommunityToolkit/Labs-Windows/issues/392

224975096-73bdeaec-411e-418a-ac5e-42d67d896017

TokenView

More info here: https://github.com/CommunityToolkit/Labs-Windows/issues/427

233386908-009022d2-42a2-4021-b785-35ffe0facf32