SettingsControls: SettingsCard + SettingsExpander #129
Replies: 5 comments 10 replies
-
Nice @michael-hawker! Here are some thoughts on what things it should support: Main card properties
SettingsExpanderItem Visual style Narrator should annouce this as Header + Content control. For example: "Windows display language - English (United States". ================ SettingsButton |
Beta Was this translation helpful? Give feedback.
-
After our recent discussion, here are some updated specifications. It seems to make most sense to create 2 separate controls: SettingsCard and SettingsExpander. SettingsCardA single card that has properties to set the icon, header, description and content (e.g. a ToggleSwitch), right aligned. It provides developers a way to display a single setting. <controls:SettingsCard Icon="" Title="This is the header" Description="And this is the description">
<ToggleSwitch IsOn="{x:Bind ViewModel.HasToDo, Mode=TwoWay}"/>
</controls:SettingsCard>
SettingsExpanderA control that enherites from WinUI.Expander thas properties to set the icon, header, description and content. It provides developers a way to group multiple options into a single UI control. Automatic layouting of controls: <controls:SettingsExpander Icon="{StaticResource FocusIcon}" Title="This is the header" Description="And this is the description">
<controls:SettingsExpander.Items> <!-- spacing of multiple items with style and corners automatic -->
<controls:SettingsExpanderItem Header="This is a first option">
<ComboBox .../>
</controls:SettingsExpanderItem>
<controls:SettingsExpanderItem Header="And a second option">
<ComboBox .../>
</controls:SettingsExpanderItem>
<controls:SettingsExpanderItem Header="And a third option">
<Button.../>
</controls:SettingsExpanderItem>
</controls:SettingsExpander.Items>
</controls:SettingsExpander> Hosting a custom panel: <controls:SettingsExpander Icon="{StaticResource FocusIcon}" Title="This is the header" Description="And this is the description">
<controls:SettingsExpander.Items>
<controls:SettingsExpanderItem Header="This is a first option">
<StackPanel ...>
<TextBlock .../>
<Button .../>
<GridView .../>
<StackPanel/>
</controls:SettingsExpanderItem>
</controls:SettingsExpander.Items>
</controls:SettingsExpander>
Open questions
|
Beta Was this translation helpful? Give feedback.
-
Question: in the first example of the settings expander I see a few settings separated by a line. What element is used for the line? |
Beta Was this translation helpful? Give feedback.
-
When adding these settings control in code-behind, it should be easy to create a title for the group as well. This can be seen in PowerToy's settings control XAML code structure is here: <uc:SettingsGroup Title="Input">
<uc:SettingsGroup.Items>
<uc:SettingsCard Icon="" Title="" Description="">
<Button Background="transparent" BorderThickness="0">
<FontIcon Glyph="" />
<Button>
</uc:SettingsCard>
<uc:SettingsCard Icon="" Title="" Description="">
<Button Background="transparent" BorderThickness="0">
<FontIcon Glyph="" />
<Button>
</uc:SettingsCard>
</uc:SettingsGroup.Items>
</uc:SettingsGroup> Also, FYI, in Windows 11 Settings, SettingsExpander has footer border(background is not same as above items): |
Beta Was this translation helpful? Give feedback.
-
This was shipped in the 8.0 Release, please update to use that version of the component. Any further issues/requests should start in the main repository. |
Beta Was this translation helpful? Give feedback.
-
Settings Expander
Problem Statement
The new settings experience in Windows 11 was met with a lot of approval and has quickly been picked up as a common practice in many applications. However, there is no standard control or design template to achieve its behavior, this makes different app's implementations and behaviors inconsistent which is bad for users. It also is more work for developers to redo this effort.
It'd be great to provide a common control that can be used for these scenarios.
Inspiration
Many community developers have worked on their own implementations of this control/pattern.
Proposed Solution
It'd be great to have a wrapper around the built-in
Expander
control as a base, and provide a succinct syntax to providing this custom experience, something like (looking at Clock app as example patterns):Simple Toggle Button
Single Radio Buttons
Collapsed:
Expanded:
Multiple Dropdown Options
Collapsed:
Expanded:
Adaptive layout
There should be logic to support smaller screen sizes:
Open Questions
API Reference Docs
References
Beta Was this translation helpful? Give feedback.
All reactions