Skip to content

Comments

Fixed Refresh Color not applying to RefreshView initially.#28638

Merged
PureWeen merged 2 commits intodotnet:inflight/currentfrom
Shalini-Ashokan:fix-16973
Apr 18, 2025
Merged

Fixed Refresh Color not applying to RefreshView initially.#28638
PureWeen merged 2 commits intodotnet:inflight/currentfrom
Shalini-Ashokan:fix-16973

Conversation

@Shalini-Ashokan
Copy link
Contributor

Issue Details

RefreshView RefreshColor does not work initially.

Root Cause

The RefreshViewVisualizer instance is initially null, preventing the RefreshColor from being set when the control is created. Since Visualizer is assigned asynchronously by the system, any attempt to set its properties too early fails.

Description of Change

To ensure that RefreshColor is applied when Visualizer becomes available, a property change callback was registered on RefreshContainer.VisualizerProperty. This callback waits until Visualizer is assigned and then applies the correct RefreshColor. Once the color is set, the callback is unregistered to avoid redundant calls.

Validated the behavior in the following platforms

  • Android
  • Windows
  • iOS
  • Mac

Issues Fixed

Fixes #16973

Output ScreenShot

Before After
BeforeFix.2.mp4
AfterFix.3.mp4

@dotnet-policy-service
Copy link
Contributor

Hey there @Shalini-Ashokan! 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 community ✨ Community Contribution partner/syncfusion Issues / PR's with Syncfusion collaboration labels Mar 26, 2025
@jsuarezruiz
Copy link
Contributor

/azp run

@azure-pipelines
Copy link

Azure Pipelines successfully started running 3 pipeline(s).

@jsuarezruiz
Copy link
Contributor

/azp run

@azure-pipelines
Copy link

Azure Pipelines successfully started running 3 pipeline(s).

@Shalini-Ashokan Shalini-Ashokan marked this pull request as ready for review April 2, 2025 11:11
Copilot AI review requested due to automatic review settings April 2, 2025 11:11
@Shalini-Ashokan Shalini-Ashokan requested a review from a team as a code owner April 2, 2025 11:11
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.

Pull Request Overview

This PR ensures that the RefreshColor property is applied properly for RefreshView on Windows by deferring its update until the Visualizer is available.

  • Introduces a property change callback to handle the asynchronous assignment of the Visualizer property.
  • Adds automated tests to validate the refresh color behavior on Windows, iOS/Mac, and Android.

Reviewed Changes

Copilot reviewed 3 out of 3 changed files in this pull request and generated 2 comments.

File Description
src/Core/src/Handlers/RefreshView/RefreshViewHandler.Windows.cs Implements a callback mechanism to update RefreshColor once Visualizer is available.
src/Controls/tests/TestCases.Shared.Tests/Tests/Issues/Issue16973.cs Provides a shared test validating that the refresh color is correctly applied.
src/Controls/tests/TestCases.HostApp/Issues/Issue16973.cs Adds a host app UI page for automated testing of the refresh color behavior across platforms.

};
label = new Label
{
AutomationId = "label",
Copy link

Copilot AI Apr 2, 2025

Choose a reason for hiding this comment

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

Ensure that the AutomationId 'label' is unique within the application context to prevent test lookup conflicts. Consider using a more descriptive and unique identifier.

Copilot uses AI. Check for mistakes.
var button = new Button
{
Text = "Change Refresh Color",
AutomationId = "button",
Copy link

Copilot AI Apr 2, 2025

Choose a reason for hiding this comment

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

Ensure that the AutomationId 'button' is unique within the application context to avoid test lookup conflicts. Consider using a more descriptive and unique identifier.

Copilot uses AI. Check for mistakes.
@PureWeen PureWeen changed the base branch from main to inflight/current April 18, 2025 09:36
@PureWeen PureWeen merged commit 47f8878 into dotnet:inflight/current Apr 18, 2025
130 checks passed
PureWeen pushed a commit that referenced this pull request Apr 23, 2025
* Fixed the refresh color is not applied to the refresh view

* Added the test case for IOS
prakashKannanSf3972 pushed a commit to prakashKannanSf3972/maui that referenced this pull request Apr 24, 2025
)

* Fixed the refresh color is not applied to the refresh view

* Added the test case for IOS
NanthiniMahalingam pushed a commit to NanthiniMahalingam/maui that referenced this pull request Apr 24, 2025
)

* Fixed the refresh color is not applied to the refresh view

* Added the test case for IOS
prakashKannanSf3972 pushed a commit to prakashKannanSf3972/maui that referenced this pull request Apr 25, 2025
)

* Fixed the refresh color is not applied to the refresh view

* Added the test case for IOS
prakashKannanSf3972 pushed a commit to prakashKannanSf3972/maui that referenced this pull request Apr 28, 2025
)

* Fixed the refresh color is not applied to the refresh view

* Added the test case for IOS
github-actions bot pushed a commit that referenced this pull request Apr 28, 2025
* Fixed the refresh color is not applied to the refresh view

* Added the test case for IOS
PureWeen pushed a commit that referenced this pull request May 2, 2025
* Fixed the refresh color is not applied to the refresh view

* Added the test case for IOS
SuthiYuvaraj pushed a commit to SuthiYuvaraj/maui that referenced this pull request May 9, 2025
)

* Fixed the refresh color is not applied to the refresh view

* Added the test case for IOS
@github-actions github-actions bot locked and limited conversation to collaborators May 19, 2025
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

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

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[MAUI] RefreshView C4 RefreshColor is not displayed correctly on Surface when refreshing.

3 participants