[.NET 10] make TabbedPageManager public#30774
Conversation
There was a problem hiding this comment.
Pull Request Overview
This pull request makes the TabbedPageManager class public in .NET MAUI for Android and adds APIs to swap it on TabbedPage.Android. This change exposes the internal tabbed page management functionality to allow for more customization of tabbed page behavior on Android.
Key changes:
- Expose
TabbedPageManageras a public class with customizable APIs - Add getter/setter property on
TabbedPagefor managing theTabbedPageManagerinstance - Update visibility modifiers from internal/private to public/protected for extensibility
Reviewed Changes
Copilot reviewed 3 out of 3 changed files in this pull request and generated 2 comments.
| File | Description |
|---|---|
TabbedPage.Android.cs |
Adds public TabbedPageManager property with validation logic for instance swapping |
PublicAPI.Unshipped.txt |
Documents new public APIs being exposed for the TabbedPageManager class |
TabbedPageManager.cs |
Changes class from internal to public and updates member visibility for extensibility |
Comments suppressed due to low confidence (2)
src/Controls/src/Core/Platform/Android/TabbedPageManager.cs:45
- The field name 'previousPage' does not follow C# naming conventions. Protected and public fields should use PascalCase naming. Consider renaming to 'PreviousPage'.
protected Page previousPage;
src/Controls/src/Core/Platform/Android/TabbedPageManager.cs:541
- The method 'SetTabIconImageSource' is marked as virtual in the PublicAPI but declared as non-virtual here. This inconsistency should be resolved by making the method virtual to match the public API contract.
void SetTabIconImageSource(Page page, TabLayout.Tab tab)
| { | ||
| if (_tabbedPageManager is not null && _tabbedPageManager != value) | ||
| { | ||
| throw new InvalidOperationException("TabbedPageManager cannot be assigned to new instance."); |
There was a problem hiding this comment.
This change introduces a new public API with the TabbedPageManager property setter. Since this is a breaking change to the public API surface, please alert reviewers that this should not be included in minor versions or service releases per the coding guidelines.
| } | ||
|
|
||
| internal void UpdateTabItemStyle() | ||
| protected virtual void UpdateStyleForTabItem() |
There was a problem hiding this comment.
The method 'UpdateStyleForTabItem' appears to duplicate the functionality of the existing 'UpdateTabItemStyle' method. Consider removing the wrapper method and making UpdateStyleForTabItem the primary method to avoid code duplication.
|
/azp run |
|
Azure Pipelines successfully started running 3 pipeline(s). |
rmarinho
left a comment
There was a problem hiding this comment.
Seems something on the public api files missing
C:\a\_work\1\s\src\Controls\src\Core\PublicAPI\net-android\PublicAPI.Unshipped.txt(28,1): error RS0025: The symbol '~virtual Microsoft.Maui.Controls.PropertyChangingEventHandler.Invoke(object sender, Microsoft.Maui.Controls.PropertyChangingEventArgs e) -> void' appears more than once in the public API files (https://github.com/dotnet/roslyn/blob/main/src/RoslynAnalyzers/PublicApiAnalyzers/PublicApiAnalyzers.Help.md) [C:\a\_work\1\s\src\Controls\src\Core\Controls.Core.csproj::TargetFramework=net9.0-android35.0]
8668 Warning(s)
1 Error(s)
78ab6ec to
0440557
Compare
0440557 to
c2cc46f
Compare
|
/azp run |
|
Azure Pipelines successfully started running 3 pipeline(s). |
188d66d to
bb7ef39
Compare
|
/azp run |
|
Azure Pipelines successfully started running 3 pipeline(s). |
jfversluis
left a comment
There was a problem hiding this comment.
+1 on people wanting to customize the tabs, so this seems like a good way for them to do that
|
/backport to release/10.0.1xx-preview7 |
|
Started backporting to release/10.0.1xx-preview7: https://github.com/dotnet/maui/actions/runs/16578072896 |
Warning
This should target .NET 10 before merge
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 of Change
Make
TabbedPageManagerpublic and add APIs to swap it onTabbedPage.Android.Issues Fixed
Related to #30762