Skip to content
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

Open
wants to merge 14 commits into
base: main
Choose a base branch
from

Conversation

devanathan-vaithiyanathan
Copy link
Contributor

@devanathan-vaithiyanathan devanathan-vaithiyanathan commented Feb 6, 2025

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.

  • Android
  • Windows
  • iOS
  • Mac

Output Screenshot

Before After
Android
Before-fix.mov
Android
After-fix.mov
Windows
Before-fix.mp4
Windows
After-fix.mp4

Copy link
Contributor

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.

@dotnet-policy-service dotnet-policy-service bot added the community ✨ Community Contribution label Feb 6, 2025
Copy link
Contributor

@jsuarezruiz jsuarezruiz left a 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)
Copy link
Contributor

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?

Copy link
Contributor Author

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

@karthikraja-arumugam karthikraja-arumugam added the partner/syncfusion Issues / PR's with Syncfusion collaboration label Feb 6, 2025
@devanathan-vaithiyanathan
Copy link
Contributor Author

devanathan-vaithiyanathan commented Feb 7, 2025

Could include an UITest based on the sample from #27494?

@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.

@devanathan-vaithiyanathan devanathan-vaithiyanathan marked this pull request as ready for review February 7, 2025 13:42
@devanathan-vaithiyanathan devanathan-vaithiyanathan requested a review from a team as a code owner February 7, 2025 13:42
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area-controls-shell Shell Navigation, Routes, Tabs, Flyout community ✨ Community Contribution partner/syncfusion Issues / PR's with Syncfusion collaboration platform/android 🤖 platform/windows 🪟
Projects
None yet
Development

Successfully merging this pull request may close these issues.

[Windows/Android] Runtime Added ShellContent Title Not Updating in TabBar
3 participants