79634575

Date: 2025-05-22 21:42:17
Score: 1
Natty:
Report link

Consider using the SelectorBar control. It already has logic for selection indicator that could be restyled and repositioned. The SelectorBar is typically meant for navigation, but it could work for this purpose as a collection control instead. Unfortunately, it does not support data virtualization or an ItemsSource property, which could be limiting depending on your use case. I suggest using with a relatively known/small quantity of items.

You can see a working example in the WinUI 3 gallery app: https://apps.microsoft.com/detail/9P3JFPWWDZRC?hl=en-us&gl=US&ocid=pdpshare

Here is a link to the default style for SelectorBar on GitHub: https://github.com/microsoft/microsoft-ui-xaml/blob/main/src/controls/dev/SelectorBar/SelectorBar.xaml

API Reference: https://learn.microsoft.com/en-us/windows/windows-app-sdk/api/winrt/microsoft.ui.xaml.controls.selectorbar

Design docs: https://learn.microsoft.com/en-us/windows/apps/design/controls/selector-bar

Reasons:
  • Probably link only (1):
  • Long answer (-0.5):
  • Has code block (-0.5):
  • Low reputation (1):
Posted by: Shane