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

Proposal: NavigationView: Improve the lightweight-styling experience of the selection indicator #2877

Open
Felix-Dev opened this issue Jul 10, 2020 · 1 comment
Assignees
Labels
area-NavigationView NavView control feature proposal New feature proposal team-Controls Issue for the Controls team

Comments

@Felix-Dev
Copy link
Contributor

Felix-Dev commented Jul 10, 2020

Proposal: NavigationView: Improve the lightweight-styling experience of the selection indicator

Summary

Currently, the appearance of the NavigationView's selection indicator cannot easily be customized using lightweight styling alone. Below you will find the current initialization of the selection indicator in the control template of a NavigationViewItemPresenter:

As we can see above, there is only the NavigationViewSelectionIndicatorForeground theme resource available to developers today. However, in order to properly customize the selection indicator appearance using lightweight styling, we should also introduce the following theme resources:

  • NavigationViewSelectionIndicatorMargin
  • NavigationViewSelectionIndicatorWidth
  • NavigationViewSelectionIndicatorHeight
  • NavigationViewSelectionIndicatorRadiusX/RadiusY or NavigationViewSelectionIndicatorCornerRadius

Rationale

This proposal, alongside proposal #2878 will enable developers to utilize the NavigationView control for their in-app navigation while easily matching in-app navigation designs seen in a variety of Windows apps, such as Windows Settings, Microsoft To Do, Your Phone, OneNote for Windows 10 and legacy Edge UWP. See below for images:

Windows Settings (Windows Settings) MS Todo (Microsoft To Do)
image (Your Phone) image (OneNote for Windows 10)
image (Edge UWP)

And for reference the current default look of the selection indicator of the WinUI NavigationView control:
image

Currently, developers would have to re-template the NavigationViewItemPresenter control or walk its visual tree in order to customize the appearance of the selection indicator. Neither approach is ideal, and especially in the case of the NavigationView, we have seen many changes in the recent weeks and months to its default control templates. In other words, after WinUI updates developers would often have to re-copy the new up-to-date control templates (and re-edit them) in order to not miss out on improvements like hierarchical navigation, better lightweight-styling support, expand/collapse chevron not being partly occluded by the scrollbar, etc....

To make the lifes of developers significantly easier here, we should provide them with a set of theme resources which they can use to customize the appearance of the selection indicator. That way, they can upgrade their WinUI version and don't have to worry about having to re-copy and re-edit the NavigationViewItemPresenter control templates after each WinUI update, big or small.

@Felix-Dev Felix-Dev added the feature proposal New feature proposal label Jul 10, 2020
@msft-github-bot msft-github-bot added the needs-triage Issue needs to be triaged by the area owners label Jul 10, 2020
@ranjeshj ranjeshj added area-NavigationView NavView control team-Controls Issue for the Controls team and removed needs-triage Issue needs to be triaged by the area owners labels Jul 10, 2020
@Felix-Dev
Copy link
Contributor Author

@YuliKl Your thoughts on this?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area-NavigationView NavView control feature proposal New feature proposal team-Controls Issue for the Controls team
Projects
None yet
Development

No branches or pull requests

4 participants