Fixed Refresh Color not applying to RefreshView initially.#28638
Fixed Refresh Color not applying to RefreshView initially.#28638PureWeen merged 2 commits intodotnet:inflight/currentfrom
Conversation
|
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. |
|
/azp run |
|
Azure Pipelines successfully started running 3 pipeline(s). |
|
/azp run |
|
Azure Pipelines successfully started running 3 pipeline(s). |
There was a problem hiding this comment.
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", |
There was a problem hiding this comment.
Ensure that the AutomationId 'label' is unique within the application context to prevent test lookup conflicts. Consider using a more descriptive and unique identifier.
| var button = new Button | ||
| { | ||
| Text = "Change Refresh Color", | ||
| AutomationId = "button", |
There was a problem hiding this comment.
Ensure that the AutomationId 'button' is unique within the application context to avoid test lookup conflicts. Consider using a more descriptive and unique identifier.
* Fixed the refresh color is not applied to the refresh view * Added the test case for IOS
* Fixed the refresh color is not applied to the refresh view * Added the test case for IOS
* Fixed the refresh color is not applied to the refresh view * Added the test case for IOS
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
Issues Fixed
Fixes #16973
Output ScreenShot
BeforeFix.2.mp4
AfterFix.3.mp4