Forum Xamarin.Forms

Different Title Views in Tabbed Page

I have tabbed page in my application and i want to show different title for the each page in the navigation.titleviews. How can achieve this?

Best Answer


  • ColeXColeX Member, Xamarin Team Xamurai
    edited January 17

    You could customize a contentView ,createTitleProperty BindableProperty and create binding with the page's Title .

    Custom ContentView

    public class NavigationView : ContentView
        public static readonly BindableProperty TitleProperty =
                                            defaultValue: null,
                                            defaultBindingMode: BindingMode.OneWayToSource);
        public string Title
            get => (string)GetValue(TitleProperty);
            set => SetValue(TitleProperty, value);

    XAML of Page

    <ContentPage xmlns="" 
        Title="{Binding Path=Content.Title, Source={x:Reference _self}}">
        <local:NavigationView Title="This is page-1">
            <Button Text="Go to page-2" Clicked="Handle_Clicked" />

    Detailed refer

  • EbubekirSezerEbubekirSezer Member ✭✭

    @ColeX It didnt work for me

  • Dinesh_OfficialDinesh_Official Member ✭✭✭

    @EbubekirSezer , Each ContentPage have a property called Title, you can assign the values for them.

    Can you please share some additional information? how you are defining pages in the tabbed page which might be helpful to share the thoughts

  • EbubekirSezerEbubekirSezer Member ✭✭

    I have default tabbed page and i navigate to the tabbed page as a NavigationPage to have titleview. I added my child tabbed like in the below in the each tab i want to show different titleview, how can i achieve that?
    Children.Add(new Content1()); Children.Add(new Content2()); Children.Add(new Content3()); Children.Add(new Content4());

  • EbubekirSezerEbubekirSezer Member ✭✭

    @Dinesh_Official thanks i followed that logic and it worked

  • Dinesh_OfficialDinesh_Official Member ✭✭✭

    @EbubekirSezer , great :).

Sign In or Register to comment.