Skip to content

BackButtonBehavior is no longer triggered once a ContentPage contains a CollectionView and the ItemsSource has been changed #33688

@MatthewJer

Description

@MatthewJer

Description

If a ContentPage contains a CollectionView whose ItemsSource property is bound to an ObservableCollection, the BackButtonBehavior is no longer triggered. If the ObservableCollection or its reference is never modified, the BackButtonBehavior works as expected. The issue can be reproduced on both iOS and Android.

Steps to Reproduce

  1. Check out the example repository.
  2. Start the app.
  3. Tap the “Navigate to other Page” button.
  4. Press the Back button.
    Expected outcome: A “Hello World” alert is displayed.
    Actual outcome: The app simply navigates back.

Note:
If the following block in NewPage1ViewModel.cs is commented out, the BackButtonBehavior is triggered correctly.
Items = new ObservableCollection<NewPage1ViewModelItem>() {//You can comment out this source code and uncomment one of the other commented-out variants. The problem persists. new NewPage1ViewModelItem(), //When all variants are commented out, the BackButtonBehavior works. new NewPage1ViewModelItem(), // new NewPage1ViewModelItem() // }; //

Link to public reproduction project repository

https://github.com/MatthewJer/TestBackButtonBehavior

Version with bug

10.0.30

Is this a regression from previous behavior?

Yes, this used to work in .NET MAUI

Last version that worked well

9.0.70 SR7

Affected platforms

iOS, Android

Affected platform versions

iOS26 Android16

Did you find any workaround?

No response

Relevant log output

Metadata

Metadata

Assignees

No one assigned

    Labels

    t/bugSomething isn't working

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions