microsoft / microsoft/microsoft-ui-xaml
Proposal: Add SelectorBar ItemsSource support
- Dominant language
- C++
- Stars
- 8.4k
- Forks
- 942
- Avg merge
- 2d 7h
- Merged PRs (30d)
- 105
Description
### Title
Proposal: Add SelectorBar ItemsSource support
### Summary
Currently, the SelectorBar in WinUI 3 only supports adding items through Items, but this isn’t very convenient when there are a lot of items. The SelectorBar internally uses ItemsView, which supports ItemsSource. Hopefully, in the future, SelectorBar will provide an ItemsSource property, so we can quickly add menu bar items through binding, just like the NavigationView Top mode.
目前 WinUI 3 的 SelectorBar 仅支持通过 Items 添加选择栏项,但是当 SelectorBar 项目多时,该属性就不太方便了。SelectorBar 内部调用的是 ItemsView,ItemsView 支持 ItemsSource,希望未来能在 SelectorBar 中提供 ItemsSource 属性,可以通过绑定快速添加菜单栏项,就像 NavigationView Top 模式一样。
### Rationale
None
### Scope
| Capability | Priority |
| :---------- | :------- |
| This proposal will allow developers to accomplish W | Must |
| This proposal will allow end users to accomplish X | Should |
| This proposal will allow developers to accomplish Y | Could |
| This proposal will allow end users to accomplish Z | Won't |
### Important Notes
None
### Open Questions
None
Contributor guide
Research direction
Start with the SelectorBar API and its internal use of ItemsView, then compare how NavigationView Top mode exposes ItemsSource. Done means defining the intended ItemsSource behavior for SelectorBar and confirming that menu items can be supplied through binding; the proposal leaves implementation files and tests unspecified.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- cpp
- Domain
- desktop
- Issue type
- Feature
- Difficulty
- 5/5
- Estimated time
- Over a week
- Activity status
- Quiet
- Clarity
- Mostly clear
- Newbie friendliness
- 35/100