KEMBAR78
[.NET 10] make TabbedPageManager public by pictos · Pull Request #30774 · dotnet/maui · GitHub
Skip to content

Conversation

pictos
Copy link
Contributor

@pictos pictos commented Jul 23, 2025

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 TabbedPageManager public and add APIs to swap it on TabbedPage.Android.

Issues Fixed

Related to #30762

@Copilot Copilot AI review requested due to automatic review settings July 23, 2025 03:12
@pictos pictos requested a review from a team as a code owner July 23, 2025 03:12
Copy link
Contributor

@Copilot 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 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 TabbedPageManager as a public class with customizable APIs
  • Add getter/setter property on TabbedPage for managing the TabbedPageManager instance
  • 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.");
Copy link

Copilot AI Jul 23, 2025

Choose a reason for hiding this comment

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

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.

Copilot uses AI. Check for mistakes.

}

internal void UpdateTabItemStyle()
protected virtual void UpdateStyleForTabItem()
Copy link

Copilot AI Jul 23, 2025

Choose a reason for hiding this comment

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

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.

Copilot uses AI. Check for mistakes.

@dotnet-policy-service dotnet-policy-service bot added the community ✨ Community Contribution label Jul 23, 2025
@jsuarezruiz
Copy link
Contributor

/azp run

@azure-pipelines
Copy link

Azure Pipelines successfully started running 3 pipeline(s).

Copy link
Member

@rmarinho rmarinho left a comment

Choose a reason for hiding this comment

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

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)

Copy link
Contributor Author

@pictos pictos left a comment

Choose a reason for hiding this comment

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

fixes

@pictos pictos requested a review from rmarinho July 23, 2025 15:15
@pictos pictos force-pushed the tabbedPageManagerPublic-net9 branch from 78ab6ec to 0440557 Compare July 24, 2025 00:29
@pictos pictos changed the base branch from main to net10.0 July 24, 2025 00:30
@pictos pictos force-pushed the tabbedPageManagerPublic-net9 branch from 0440557 to c2cc46f Compare July 24, 2025 00:31
@rmarinho
Copy link
Member

/azp run

@azure-pipelines
Copy link

Azure Pipelines successfully started running 3 pipeline(s).

rmarinho
rmarinho previously approved these changes Jul 24, 2025
@github-project-automation github-project-automation bot moved this from Todo to Approved in MAUI SDK Ongoing Jul 24, 2025
@rmarinho rmarinho requested review from PureWeen and removed request for StephaneDelcroix and jfversluis July 24, 2025 09:36
@pictos pictos force-pushed the tabbedPageManagerPublic-net9 branch from 188d66d to bb7ef39 Compare July 24, 2025 21:53
@pictos pictos requested a review from rmarinho July 24, 2025 22:29
@PureWeen
Copy link
Member

/azp run

@PureWeen PureWeen added the p/0 Work that we can't release without label Jul 25, 2025
@PureWeen PureWeen moved this from Approved to Ready To Review in MAUI SDK Ongoing Jul 25, 2025
@azure-pipelines
Copy link

Azure Pipelines successfully started running 3 pipeline(s).

Copy link
Member

@jfversluis jfversluis left a comment

Choose a reason for hiding this comment

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

+1 on people wanting to customize the tabs, so this seems like a good way for them to do that

@github-project-automation github-project-automation bot moved this from Ready To Review to Approved in MAUI SDK Ongoing Jul 28, 2025
@PureWeen
Copy link
Member

/backport to release/10.0.1xx-preview7

@github-actions
Copy link
Contributor

Started backporting to release/10.0.1xx-preview7: https://github.com/dotnet/maui/actions/runs/16578072896

@rmarinho rmarinho merged commit 756b409 into dotnet:net10.0 Jul 29, 2025
129 checks passed
@github-project-automation github-project-automation bot moved this from Approved to Done in MAUI SDK Ongoing Jul 29, 2025
@github-actions github-actions bot locked and limited conversation to collaborators Aug 29, 2025
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

area-controls-tabbedpage TabbedPage community ✨ Community Contribution p/0 Work that we can't release without

Projects

Status: Done

Development

Successfully merging this pull request may close these issues.

5 participants