1

Context

I am using the ExrinSampleMobileApp from the Exrin repository.

Question

How can I set the main and detail tab's title?

I tried to set the appropriate view's title with no effect (DetaiView and MainView)

enter image description here

g.pickardou
  • 32,346
  • 36
  • 123
  • 268

1 Answers1

1

Because everything is wrapped in a NavigationPage, you need to set the Title of the NavigationPage. The easiest way to do this is via the Stack.

When you pass through a new NavigationPage, set it's title, as shown here.

public class MainStack : BaseStack
{

    public MainStack(IViewService viewService)
        : base(new NavigationProxy(new NavigationPage() { Title = "My Title" }), 
                                   viewService, 
                                   Stacks.Main, 
                                   nameof(Main.Main))
    {
        ShowNavigationBar = false;
    }

    protected override void Map()
    {
        base.NavigationMap<AboutView, AboutViewModel>(nameof(Main.About));
        base.NavigationMap<MainView, MainViewModel>(nameof(Main.Main));            
        base.NavigationMap<SettingsView, SettingsViewModel>(nameof(Main.Settings));
        base.NavigationMap<View.ListView, ListViewModel>(nameof(Main.List));
        base.NavigationMap<DetailView, DetailViewModel>(nameof(Main.Detail));
    }

}
Adam
  • 16,089
  • 6
  • 66
  • 109
  • Adam, many thanks, this works. Just a though: In the ExrinSampleMobileApp some navigation occur _within_ the left side tab, say the Settings page shows up there, then the tab title should be updated. But before jumping into modify the navigation logic, it worth to mention, that kind of navigation is not a real-life scenario. ... to be continued... (sorry to violating SO comment limits, this is my first case) – g.pickardou Sep 22 '17 at 10:09
  • ...continuing... This case the user would like to see a standalone (and not tabbed) page _or_ and other tabbed page, but not the very same right side with a changed left side content. This is strongly related with my other question, how to have one master detail with a drawer menu, and the menu navigates within one stack, and some of target the pages are single, one of them tabbed, – g.pickardou Sep 22 '17 at 10:09