Add IsRefreshEnabled Property and Platform-Consistent IsEnabled Semantics to RefreshView#30692
Merged
Add IsRefreshEnabled Property and Platform-Consistent IsEnabled Semantics to RefreshView#30692
Conversation
Copilot
AI
changed the title
[WIP] Proposal: Add IsRefreshEnabled Property and Platform-Consistent IsEnabled Semantics to RefreshView
Add IsRefreshEnabled Property and Platform-Consistent IsEnabled Semantics to RefreshView
Jul 17, 2025
mattleibow
requested changes
Jul 17, 2025
src/Core/src/Handlers/RefreshView/RefreshViewHandler.Android.cs
Outdated
Show resolved
Hide resolved
src/Core/src/Handlers/RefreshView/RefreshViewHandler.Windows.cs
Outdated
Show resolved
Hide resolved
src/Core/src/Handlers/RefreshView/RefreshViewHandler.Windows.cs
Outdated
Show resolved
Hide resolved
src/Core/src/Handlers/RefreshView/RefreshViewHandler.Windows.cs
Outdated
Show resolved
Hide resolved
src/Controls/tests/TestCases.Shared.Tests/Tests/Issues/Issue30690.cs
Outdated
Show resolved
Hide resolved
d329ca7 to
c3ba804
Compare
9e2530b to
f484ee2
Compare
Contributor
There was a problem hiding this comment.
Pull Request Overview
This PR introduces the IsRefreshEnabled property to RefreshView and standardizes IsEnabled behavior across all platforms. The new property provides granular control over the pull-to-refresh gesture while keeping child controls interactive, addressing inconsistent platform behaviors that were breaking Blazor Hybrid apps and other scenarios.
- Adds
IsRefreshEnabledproperty for granular refresh control - Standardizes
IsEnabledbehavior to disable entire view tree on all platforms - Updates platform handlers to support both properties consistently
Reviewed Changes
Copilot reviewed 26 out of 26 changed files in this pull request and generated 2 comments.
Show a summary per file
| File | Description |
|---|---|
src/Core/src/Core/IRefreshView.cs |
Adds IsRefreshEnabled property to interface with conditional compilation support |
src/Core/src/Handlers/RefreshView/RefreshViewHandler.cs |
Maps new IsRefreshEnabled property to platform handlers |
src/Core/src/Handlers/RefreshView/RefreshViewHandler.*.cs |
Platform-specific implementations for IsRefreshEnabled mapping |
src/Core/src/Platform/iOS/MauiRefreshView.cs |
iOS platform implementation with new UpdateIsRefreshEnabled method |
src/Core/src/Platform/Android/MauiSwipeRefreshLayout.cs |
Android platform implementation with RefreshEnabled property |
src/Controls/src/Core/RefreshView/RefreshView.cs |
Core RefreshView implementation with new property and coercion logic |
src/Controls/tests/Core.UnitTests/RefreshViewTests.cs |
Comprehensive unit tests for new functionality |
src/Controls/tests/DeviceTests/Elements/RefreshView/RefreshViewTests.cs |
Device-level tests for RefreshView behavior |
src/Controls/tests/TestCases.HostApp/Issues/Issue30690.cs |
UI test page for manual and automated testing |
src/Controls/tests/TestCases.Shared.Tests/Tests/Issues/Issue30690.cs |
Automated UI tests for cross-platform behavior validation |
| Multiple PublicAPI.Unshipped.txt files | API surface documentation updates |
Member
|
/azp run |
|
Azure Pipelines successfully started running 3 pipeline(s). |
f484ee2 to
f974b43
Compare
Member
|
/reabase |
f974b43 to
506688b
Compare
Member
|
/azp run |
|
Azure Pipelines successfully started running 3 pipeline(s). |
f9f7036 to
1282af0
Compare
Member
|
/azp run |
|
Azure Pipelines successfully started running 3 pipeline(s). |
Member
|
/azp run |
|
Azure Pipelines successfully started running 3 pipeline(s). |
Member
|
/rebase |
Member
|
/azp run |
|
Azure Pipelines successfully started running 3 pipeline(s). |
Member
|
/azp run |
|
Azure Pipelines successfully started running 3 pipeline(s). |
UI tests do not support scroll up: #31216
b99782b to
d0975a6
Compare
Member
|
/azp run |
|
Azure Pipelines successfully started running 3 pipeline(s). |
Member
|
/azp run |
|
Azure Pipelines successfully started running 3 pipeline(s). |
rmarinho
approved these changes
Aug 19, 2025
Member
|
Failing tests doesn't seem related, saw it failing in other PR s |
This was referenced Aug 19, 2025
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to subscribe to this conversation on GitHub.
Already have an account?
Sign in.
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Note
Are you waiting for the changes in this PR to be merged?
It would be very helpful if you could test the resulting artifacts from this PR and let us know in a comment if this change resolves your issue. Thank you!
Summary
This PR introduces the
IsRefreshEnabledproperty toRefreshViewand ensures consistentIsEnabledbehavior across all platforms, addressing multiple community pain points where disabling RefreshView had inconsistent effects on child controls.Problem
Currently, setting
IsEnabled=falseon RefreshView behaves inconsistently across platforms:This creates blocking issues for Blazor Hybrid apps and other scenarios where developers need granular control over refresh behavior.
Solution
1. New
IsRefreshEnabledPropertyAdded a new property that provides granular control over just the pull-to-refresh gesture:
2. Consistent
IsEnabledBehaviorMade
IsEnabledbehavior consistent across all platforms - when set tofalse, it now disables the entire view tree on all platforms:Key Changes
IsRefreshEnabledproperty toIRefreshViewinterface andRefreshViewclassIsRefreshing = truewhen eitherIsEnabledorIsRefreshEnabledis falseIsEnabled = falsefor consistencyUsage Examples
Disable refresh during login (keep form interactive)
Disable everything during maintenance
Testing
Breaking Changes
None - This is a purely additive change. Existing code continues to work exactly as before, but now with consistent behavior across platforms.
Migration Guide
For developers who were relying on platform-specific
IsEnabledbehavior:Fixes #30690
Fixes #28361
💡 You can make Copilot smarter by setting up custom instructions, customizing its development environment and configuring Model Context Protocol (MCP) servers. Learn more Copilot coding agent tips in the docs.