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

Fixed Toolbar IconImageSource not updating with Binding Changes #27402

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

Conversation

NirmalKumarYuvaraj
Copy link
Contributor

Issue Details

The toolbar item's FontImageSource Glyph is not reflecting changes when the bound property is updated in the ViewModel. The icon remains static despite property changes in the binding source.

Root Cause

The MenuItem class lacks an implementation to listen for source changes in the IconImageSource property. When the Glyph property changes in the bound FontImageSource, the MenuItem is not notified of this change.As a result, the visual update is not triggered in the UI

Description of Change

Implementing a source changed event listener for IconImageSource in the ImageSource call back. When the ImageSource changes are detected, manually triggering PropertyChanged for IconImageSource.This propagates the change through the UI update mechanism, ensuring the toolbar icon reflects the new state.

Validated the behaviour in the following platforms

  • Android
  • Windows
  • iOS
  • Mac

Issues Fixed

Fixes #8295

Output

Before After
Before.mov
After.mov

@dotnet-policy-service dotnet-policy-service bot added the community ✨ Community Contribution label Jan 28, 2025
@vishnumenon2684 vishnumenon2684 added the partner/syncfusion Issues / PR's with Syncfusion collaboration label Jan 28, 2025
@jsuarezruiz
Copy link
Contributor

/azp run

Copy link

Azure Pipelines successfully started running 3 pipeline(s).

{
App.WaitForElement(ToggleGlyphButton);
App.Tap(ToggleGlyphButton);
VerifyScreenshot();
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pending snapshots. Are available in the latest build. Could you commit the images?
image

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 , The Mac platform snapshot is not proper. I have attached the snapshots for remaining platforms. please let me know if you have any concerns.

Mac
ToolbarItemFontIconSourceChangesAtRunTime (1)

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Let me take a look.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Will be fixed by #27492
Let's wait until merge it, then we can rebase and trigger a new build

@NirmalKumarYuvaraj NirmalKumarYuvaraj marked this pull request as ready for review February 3, 2025 03:26
@NirmalKumarYuvaraj NirmalKumarYuvaraj requested a review from a team as a code owner February 3, 2025 03:26
@dotnet dotnet deleted a comment from azure-pipelines bot Feb 5, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
community ✨ Community Contribution partner/syncfusion Issues / PR's with Syncfusion collaboration
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Can't Change ToolbarItem FontIconSource Glyph After Load
3 participants