Skip to content

[Bug]: SelectorBarSegmented's SelectedIndex property not getting updated on change #205

Closed

Description

@MPITech

Describe the bug

Hello @ghost1372! I hope you are well. I was using the CommunityToolkit's Segmented control with the following setup, then switched the control to DevWinUI's SelectorBarSegmented control and the SelectedIndex property is no longer being updated on SelectorBarItem change. Am I doing something wrong here? Thanks a lot.

Steps to reproduce the bug

  1. Set up a SelectorBarSegmented control similar to the following, binding the SelectedIndex to a 2-way property.
  2. Click the different SelectorBarItems.
  3. The SelectedIndex property never gets updated.

<devWinUi:SelectorBarSegmented x:Name="WIPSection" Height="36" Margin="6,6,6,6" HorizontalAlignment="Center" VerticalAlignment="Center" SelectedIndex="{x:Bind ViewModel.CurrentWIPSectionIndex, Mode=TwoWay, UpdateSourceTrigger=PropertyChanged}" SelectionMode="Single"> <SelectorBarItem Text="WIP Board" Padding="14,0,14,0" Icon="{winUi1:FluentIcon Icon=GridKanban}" IsSelected="True" /> <SelectorBarItem Text="WIP Grid" Padding="14,0,14,0" Icon="{winUi1:FluentIcon Icon=Grid}" /> <SelectorBarItem Text="Proofs" Padding="14,0,14,0" Icon="{winUi1:FluentIcon Icon=EyeTracking}" /> <SelectorBarItem Text="Reports" Padding="14,0,14,0" Icon="{winUi1:FluentIcon Icon=DocumentSearch}" /> </devWinUi:SelectorBarSegmented>

public class WIP : ObservableObject, IDisposable { private int _currentWipSection = 0; public int CurrentWIPSectionIndex { get => _currentWipSection; set { if (_currentWipSection != value) // breakpoint set here never gets hit { _currentWipSection = value; OnPropertyChanged(nameof(CurrentWIPSectionIndex)); } } }

Expected behavior

For the SelectedIndex property to change and the breakpoint set in CurrentWIPSectionIndex to be hit on change.

Screenshots

No response

NuGet package version

DevWinUI 10.0.0

IDE

Visual Studio 2026

Additional context

I am on 10.3.0.

Activity

  1. ghost1372 commented on Aug 25, 2026

    @ghost1372
    Owner

    Hi @MPITech
    Thank you for your report. it is now fixed with 9f4b8b3

  2. added
    bug
    on Aug 25, 2026
  3. MPITech commented on Aug 26, 2026

    @MPITech
    Author

    Thanks a lot!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    bug

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions