Skip to content

[Windows] Fix for FontImageSource color is not applied to the Tab Icon on the TabbedPage#26888

Merged
jfversluis merged 6 commits intodotnet:inflight/currentfrom
Tamilarasan-Paranthaman:fix-26752
Aug 29, 2025
Merged

[Windows] Fix for FontImageSource color is not applied to the Tab Icon on the TabbedPage#26888
jfversluis merged 6 commits intodotnet:inflight/currentfrom
Tamilarasan-Paranthaman:fix-26752

Conversation

@Tamilarasan-Paranthaman
Copy link
Member

@Tamilarasan-Paranthaman Tamilarasan-Paranthaman commented Dec 31, 2024

Root Cause of the issue

  • The FontImageSource icon color is not considered when applying the Icon's Foreground

Description of Change

  • The issue was resolved by storing the FontImageSource icon color in the IconColor property of the ViewModel. If IconColor is not null, the Foreground property retrieves the icon color and applies it to the icon's foreground. If IconColor is null, the Foreground property uses the SelectedForeground and UnselectedForeground values based on the IsSelected property and applies them to the icon's foreground.
  • Additionally, I have handled the dynamic updates to the Icon and IconColor properties in the OnPagePropertyChanged method

Issues Fixed

Fixes #26752

Test Case

Tested the behaviour in the following platforms

  • Windows
  • Android
  • iOS
  • Mac

Screenshot

Before Issue Fix After Issue Fix

@dotnet-policy-service dotnet-policy-service bot added the community ✨ Community Contribution label Dec 31, 2024
@dotnet-policy-service
Copy link
Contributor

Hey there @Tamilarasan-Paranthaman! Thank you so much for your PR! Someone from the team will get assigned to your PR shortly and we'll get it reviewed.

@Tamilarasan-Paranthaman Tamilarasan-Paranthaman added the partner/syncfusion Issues / PR's with Syncfusion collaboration label Dec 31, 2024
@Tamilarasan-Paranthaman Tamilarasan-Paranthaman marked this pull request as ready for review January 3, 2025 14:24
@Tamilarasan-Paranthaman Tamilarasan-Paranthaman requested a review from a team as a code owner January 3, 2025 14:24
@jfversluis
Copy link
Member

/azp run

@azure-pipelines
Copy link

Azure Pipelines successfully started running 3 pipeline(s).

(vm, page) =>
{
vm.Icon = page.IconImageSource?.ToIconSource(handler.MauiContext!)?.CreateIconElement();
vm.IconColor = (page.IconImageSource as FontImageSource)?.Color?.AsPaint()?.ToPlatform();
Copy link
Contributor

Choose a reason for hiding this comment

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

Could include an UITest and validate the colors with the VerifyScreenshot method?

Copy link
Contributor

Choose a reason for hiding this comment

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

The test case has already been added to the following PR. We can re-enable it for Windows once the PR has been merged.

PR : #26757

Or Do I need to add the same test case in this PR as well?

Copy link
Contributor

Choose a reason for hiding this comment

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

Yes, in this PR, remove the #if TEST_FAILS_ON_WINDOWS compilation directive from the FontImageSourceColorShouldApplyOnTabIcon test and commit the snapshot to validate the test.

@PureWeen PureWeen added this to the .NET 9 SR5 milestone Feb 13, 2025
@jsuarezruiz
Copy link
Contributor

/rebase

@jsuarezruiz
Copy link
Contributor

/azp run

@azure-pipelines
Copy link

Azure Pipelines successfully started running 3 pipeline(s).

jfversluis
jfversluis previously approved these changes Feb 25, 2025
@jfversluis jfversluis requested a review from PureWeen February 28, 2025 14:21
Copy link
Member

@PureWeen PureWeen left a comment

Choose a reason for hiding this comment

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

Can you grab the test that's on
#26757

And just include it here for now? That way we can test and validate this PR against that scenario?

We'll just resolve the conflicts once either of these merge

@github-project-automation github-project-automation bot moved this from Approved to Changes Requested in MAUI SDK Ongoing Mar 3, 2025
@jsuarezruiz
Copy link
Contributor

#26757

Agree, will like to have the test from #26757 here to validate the changes directly without wait to merge. We can fix conflicts later if necessary.

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.

The fix looks good, but, could you include the test Issue26662 from https://github.com/dotnet/maui/pull/26757/files here?

@Ahamed-Ali Ahamed-Ali dismissed stale reviews from jfversluis and StephaneDelcroix via 8fa0858 March 5, 2025 15:52
@Ahamed-Ali
Copy link
Contributor

The fix looks good, but, could you include the test Issue26662 from https://github.com/dotnet/maui/pull/26757/files here?

The test sample and the test case have been included. Could you please check? @jfversluis / @PureWeen

@PureWeen PureWeen modified the milestones: .NET 9 SR6, .NET 9 SR7 Mar 24, 2025
@jsuarezruiz
Copy link
Contributor

/azp run

@azure-pipelines
Copy link

Azure Pipelines successfully started running 3 pipeline(s).

@jsuarezruiz
Copy link
Contributor

jsuarezruiz commented Jun 9, 2025

/azp run MAUI-UITests-public

@azure-pipelines
Copy link

Azure Pipelines successfully started running 1 pipeline(s).

@jfversluis
Copy link
Member

/rebase

Copilot AI review requested due to automatic review settings August 27, 2025 13:48
Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

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

Copilot encountered an error and was unable to review this pull request. You can try again by re-requesting a review.

@azure-pipelines
Copy link

Azure Pipelines successfully started running 1 pipeline(s).

@jfversluis jfversluis changed the base branch from main to inflight/current August 29, 2025 12:08
@jfversluis jfversluis merged commit 4bf6a5d into dotnet:inflight/current Aug 29, 2025
1 check passed
@github-actions github-actions bot locked and limited conversation to collaborators Sep 29, 2025
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

area-controls-tabbedpage TabbedPage community ✨ Community Contribution partner/syncfusion Issues / PR's with Syncfusion collaboration

Projects

None yet

Development

Successfully merging this pull request may close these issues.

FontImageSource color is not applied to the Tab Icon on Windows for the Tabbedpage

7 participants