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
- Check out the example repository.
- Start the app.
- Tap the “Navigate to other Page” button.
- 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
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
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