NavigationRail for MaterialDesign3 ListBox #2682
Closed
StefanoRivolta-Previero
started this conversation in
General
Replies: 1 comment
-
This is nice work! The style should go into MaterialDesign3.ListBox.xaml (you can see f.e. MaterialDesign3.TextBox,xaml already added). |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
I've updated the ListBox style to match the new MaterialDesign 3 guidelines for the NavigationRail. You can find the changes in this fork:
https://github.com/StefanoRivolta-Previero/MaterialDesignInXamlToolkit/tree/listbox
Material Design Guidelines:
Result:
The process to create an Item is a bit complex, since it needs two icons (one filled for when it's selected, and one outlined for when it's unselected) and a text under the selection border.
I've opted for the content to only be the text part, while the icons get set trough a style property, like this:
Or like this with ItemSource Binding
To set the NavigationRail in "Icon only mode" you can use the property:
<Setter Property="materialDesign:ListBoxItemAssist.IsTextVisible" Value="False"/>
The sample is under NavigationRail page in MaterialDesign3Demo app.
Conclusion
So I'm waiting for feedback before cleaning up and in case making a Pull Request.
Also I'm not sure about the new Material Design 3 structure, for now the styles are in the standard MaterialDesignTheme.ListBox.xaml file. If it should go somewhere else, please let me know.
Beta Was this translation helpful? Give feedback.
All reactions