Mark OffscreenPageLimitProperty as obsolete and remove unused code#31306
Merged
jfversluis merged 3 commits intoAug 28, 2025
Conversation
Co-authored-by: PureWeen <5375137+PureWeen@users.noreply.github.com>
Copilot
AI
changed the title
[WIP] Mark OffscreenPageLimitProperty as obsolete
Mark OffscreenPageLimitProperty as obsolete throughout the codebase
Aug 23, 2025
Member
|
/azp run |
|
Azure Pipelines successfully started running 3 pipeline(s). |
Contributor
There was a problem hiding this comment.
Pull Request Overview
This PR marks the OffscreenPageLimitProperty and related APIs as obsolete throughout the .NET MAUI codebase to signal deprecation without breaking existing functionality. The change provides clear guidance to developers that these APIs are deprecated while maintaining backward compatibility.
Key Changes
- Applied
[System.Obsolete]attributes to five APIs in the AndroidSpecific TabbedPage configuration - Added pragma warning suppressions around internal usage sites to maintain clean builds
- Preserved all existing functionality while signaling future removal
Reviewed Changes
Copilot reviewed 3 out of 3 changed files in this pull request and generated no comments.
| File | Description |
|---|---|
| src/Controls/src/Core/PlatformConfiguration/AndroidSpecific/TabbedPage.cs | Added obsolete attributes to OffscreenPageLimit APIs |
| src/Controls/src/Core/Platform/Android/TabbedPageManager.cs | Added pragma warning suppression around obsolete API usage |
| src/Compatibility/Core/src/Android/AppCompat/TabbedPageRenderer.cs | Added pragma warning suppression around obsolete API usage |
PureWeen
reviewed
Aug 23, 2025
The UpdateOffscreenPageLimit method in TabbedPageManager.cs was unused - no code called it within this class. The method is still preserved in the Compatibility layer (TabbedPageRenderer.cs) where it is actually used. Co-authored-by: PureWeen <5375137+PureWeen@users.noreply.github.com>
Copilot
AI
changed the title
Mark OffscreenPageLimitProperty as obsolete throughout the codebase
Mark OffscreenPageLimitProperty as obsolete and remove unused code
Aug 23, 2025
Member
|
/asp run |
Contributor
|
/azp run |
|
Azure Pipelines successfully started running 3 pipeline(s). |
jfversluis
approved these changes
Aug 28, 2025
jfversluis
approved these changes
Aug 28, 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!
Description
This PR marks the
OffscreenPageLimitPropertyand all related methods as obsolete throughout the .NET MAUI codebase to indicate that these APIs are deprecated and should not be used in future development. Additionally, it removes unused code that was identified during the review process.Changes
API Deprecation
Applied
[System.Obsolete]attributes to the following APIs inMicrosoft.Maui.Controls.PlatformConfiguration.AndroidSpecific.TabbedPage:OffscreenPageLimitProperty- The BindableProperty definitionGetOffscreenPageLimit(BindableObject)- Static getter methodSetOffscreenPageLimit(BindableObject, int)- Static setter methodOffscreenPageLimit(IPlatformElementConfiguration<Android, FormsElement>)- Extension methodSetOffscreenPageLimit(IPlatformElementConfiguration<Android, FormsElement>, int)- Extension setter methodImplementation Updates
#pragma warning disable CS0618around existing usage sites to suppress obsolete warnings in internal implementation code:TabbedPageRenderer.UpdateOffscreenPageLimit()(Compatibility layer)UpdateOffscreenPageLimit()method fromTabbedPageManager.cssince no code was calling itUpdateOffscreenPageLimit()method inTabbedPageRenderer.cs(compatibility layer) where it is actually usedCode Cleanup
The unused
UpdateOffscreenPageLimit()method in the modernTabbedPageManagerimplementation was removed as it was never called, while preserving the same method in the compatibility layer where it's properly utilized.Impact
Testing
This change follows the established pattern for deprecating APIs in the .NET MAUI codebase and provides clear guidance to developers about the future direction of these APIs.
✨ Let Copilot coding agent set things up for you — coding agent works faster and does higher quality work when set up for your repo.