dotnet / dotnet/maui

Shell TitleView Not updating binding after navigation

Open
#12,416 4 comments 4 reactions 0 assignees View on GitHub
area-controls-shell platform/android s/triaged s/verified t/bug
Dominant language
C#
Stars
23.3k
Forks
2k
Avg merge
1d 15h
Merged PRs (30d)
290

Description

### Description

The Text binding of a label inside a Shell TitleView is not updating correctly when navigating to a non flyout page from a flyout page and back, the binding still displays the previous value. If I navigate between flyout pages the TitleView is updated correctly. The issue occurs on Android, iOS and Windows update the TitleView as expected.

### Steps to Reproduce

1. In Visual studio create a new MAUI App.
2. Add a second Flyout page.
3. Add a new page e.g SettingsPage and add a route for it.
4. Add a button to each flyout page to navigate to the SettingsPage.
5. Add a view model for the AppShell and each flyout page.
6. Add a custom shell TitleView and bind the title's Text property to the AppShellViewModel Title property.
7. Implement a handler for the OnPageAppearing event of the Application.Currrent.PageAppearing event and update the title text every time a page appears.
8. Launch the app on Android
9. Press the settings button on the first flyout page and then go back.
10. The title updates correctly on the first navigation (to the settings page) but not when going back.
11. Navigating between the flyout pages updates the title text correctly.

Tested ok on iOS 15 & 16 but it is not updating the TitleView binding on Android 11 & 12.

### Link to public reproduction project repository

https://github.com/harrykontopoulos/TitleViewBindingExampleMauiApp

### Version with bug

7.0 (current)

### Last version that worked well

Unknown/Other

### Affected platforms

Android

### Affected platform versions

Android 11 and 12

### Did you find any workaround?

_No response_

### Relevant log output

_No response_

Contributor guide

Open the contributing guide

Research direction

Start with the linked TitleViewBindingExampleMauiApp reproduction and trace the Shell TitleView binding through navigation from a flyout page to SettingsPage and back. Confirm the Android 11/12 behavior against the working iOS and Windows behavior; done means the title binding updates after returning from the non-flyout page.

Written by the indexing model from the issue text.

Assessment

Tech stack
android, csharp
Domain
frontend, mobile
Issue type
Bug
Difficulty
3/5
Estimated time
1-2 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
38/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.