Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Enhancement] [TabbedPage] Configure TabbedPage Title #3188

Open
lucacivale opened this issue Jul 10, 2024 · 4 comments
Open

[Enhancement] [TabbedPage] Configure TabbedPage Title #3188

lucacivale opened this issue Jul 10, 2024 · 4 comments
Milestone

Comments

@lucacivale
Copy link
Contributor

Summary

With Maui 8.0.40 the display of the TabbedPage title has changed. Unfortunately this has an impact on Prism because currently no title is displayed because we can't configure it with the ITabbedSegmentBuilder.
I attached a simple repro to show the current behavior.
PrismTabbedPageTitle.zip

API Changes

Add a new method to ITabbedSegmentBuilder to configure the TabbedPage title

ITabbedSegmentBuilder SetTitle(string title);

Intended Use Case

Create tabs with a configured title

navigationService.CreateBuilder()
  .AddTabbedSegment(tab =>
  {
      tab.SetTitle("MyTitle");
      tab.CreateTab("PageA");
      tab.CreateTab("PageB");
      tab.CreateTab("PageC");
  });
@dansiegel dansiegel added this to the vNext milestone Jul 19, 2024
@dansiegel
Copy link
Member

Keep in mind there is already an API for setting the TabbedPage title and Icon
https://github.com/PrismLibrary/Prism/blob/master/src/Maui/Prism.Maui/Navigation/Xaml/TabbedPage.cs

@lucacivale
Copy link
Contributor Author

Thanks didn't know this API but how would this help me with dynamically created TabbedPages? I don't have access to the created page without creating e.g. a behavior or do I miss something?

@dansiegel
Copy link
Member

So let's say you have something like this:

navService.NavigateAsync("TabbedPage?createTab=TabA");

You might have:

public class TabAViweModel
{
    public string TabTitle => "Awesome Tabs";
}
<Page x:class="MyProject.Views.TabA"
      prism:TabbedPage.Title="{Binding TabTitle}">

@lucacivale
Copy link
Contributor Author

Ahhh, great thank you!
This will do it for the moment

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants