-
Notifications
You must be signed in to change notification settings - Fork 1.8k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[Windows/Android] Fix Dynamic ShellContent Title Updates at Runtime #27609
base: main
Are you sure you want to change the base?
[Windows/Android] Fix Dynamic ShellContent Title Updates at Runtime #27609
Conversation
…sLayout is set for Tablet but not on mobile devices (dotnet#26152)" This reverts commit 0ddc794.
…msLayout is set for Tablet but not on mobile devices (dotnet#26152)" This reverts commit 4b9074c.
Hey there @devanathan-vaithiyanathan! Thank you so much for your PR! Someone from the team will get assigned to your PR shortly and we'll get it reviewed. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Could include an UITest based on the sample from #27494?
@@ -16,14 +16,6 @@ public ShellContentHandler() : base(Mapper, CommandMapper) | |||
{ | |||
} | |||
|
|||
internal static void MapTitle(ShellContentHandler handler, ShellContent item) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The mapper was not invoking the method never?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@jsuarezruiz , Previously, the MapTitle method was only called when changing the title within the same ShellContent page, preventing title changes between different ShellContent pages. Since other platforms support this behavior, I removed MapTitle and applied the fix to the ShellSection. With this change, the title now updates correctly during the initial load, at runtime when adding ShellContent, and when changing title between ShellContent pages, ensuring consistency across all platforms
@jsuarezruiz , I did not add a new test case because the test cases added in #26062 for iOS. These tests are applicable to my changes as well. |
Root Cause
Runtime scenarios for ShellContent were not properly handled. When ShellContent was added or removed dynamically, its property changes (such as title updates) were not tracked correctly.
Description of Change
Android: Added handling for ShellContent runtime changes in ShellSectionRenderer by subscribing and unsubscribing to ShellContent.PropertyChanged events. This ensures that property updates, such as title changes, are correctly applied when ShellContent is added or removed dynamically.
Windows: Moved title update handling from ShellContentHandler.Windows to ShellSectionHandler.Windows. This modification ensures that title changes are handled properly for both initial and dynamically added ShellContent items.
Issues Fixed
Fixes #27494
Regarding test case
Added a test case for runtime-added ShellContent title updates in PR #26062 . These tests are applicable to my changes as well
Tested the behavior in the following platforms.
Output Screenshot
Before-fix.mov
After-fix.mov
Before-fix.mp4
After-fix.mp4