Open ghost opened 3 years ago
I would love to increase the number of levels we do resource redirection at, however our system doens't really support this very well. When a resource lookup occurs in the framework, the systems starts looking for a resource with the key "foo" when it finds a resource somewhere in the tree that redirects to a different resource named "bar" the systems continues its lookup from the spot that it found "foo". This means that if "bar" was defined ad a narrower scope than we found "foo" at, the system would miss the "bar" declaration. This really prevents us from having a robust resourcing story, like what you suggesting would help us with. However it is much more performant.
So this proposal is dependent on https://github.com/microsoft/microsoft-ui-xaml/issues/2913
Proposal: New resources for styling menus consistently
Summary
I propose adding a couple new common resources to easily set the same padding, margin and item height among various menus.
Rationale
Scope
Important Notes
Horizontal menus (e.g. CommandBar, NavigationView in top mode, MenuBar)
HorizontalMenuPadding
HorizontalMenuItemMargin
HorizontalMenuItemHeight
Vertical menus (all flyouts with a list of buttons)
VerticalMenuPadding
VerticalMenuItemMargin
VerticalMenuItemHeight
Controls can be updated to use these resources. All existing lightweight resources should continue to work.
Where they can be used:
Here is a working example of horizontal and vertical menus using those resources:
This proposal can solve all inconsistencies in #4383.
Most controls would only need to change explicit values to those resources. Some controls might need very minor changes.
Extra
CommandBar has resources to set an inner margin, which allows the item to be hovered from outside the visual. This would continue to work with this proposal, but it could be extended to the other menus in the future.
Open questions
Additional notes
If this is approved, I'd like to work on this.