We use cookies to give you the best experience on our website. If you continue to browse, then you agree to our privacy policy and cookie policy. Image for the cookie policy date
close icon

NavigationBar TitleView of TabItem

Hello.


I am using SfTabView to have my TabbedPage ("MyTabbedPage") ...
I need that each Page has it own Title in the NavigationBar. But if I do 

MainPage = new NavigationPage( new MyTabbedPage());

And I set NavigationPage.TitleView in each Page, it doesn't appear. Just appear if I put NavigationPage.TitleView inside of MyTabbedPage (SfTabView), but in this case how can I bind the TitleView properties to each page ?
Supposing that I have Page1 and Page2 as SfTabItems, but Page1 need to have it's Title and Icons.


5 Replies

SR Shivani Ramakrishnan Syncfusion Team October 10, 2022 07:32 AM

Hi Marcelo,


We have looked into your query. We have prepared a sample as your requirement and updated the NavigationPage.TitleView using SelectionChanging event in SfTabView based on selection index. We have attached a sample for your reference which can be downloaded from the attachment.


We ask you to try our sample and if your requirement is different, please explain to us briefly. It will help us to provide the proper solution at the easiest. Please let us know if you need any other details.


Regards,

Shivani


Attachment: NavigationBarTabItem_e391bc77.zip


MC marcelo couto fernandes October 10, 2022 08:45 AM

Thanks. Seems that works as I expect. Let me try...


How can I bind the  SelectionChanging to a command on viewmodel?



SR Shivani Ramakrishnan Syncfusion Team October 11, 2022 07:41 AM

Hi Marcelo,


Query: How can I bind the SelectionChanging to a command on viewmodel


We have looked into your query. We have prepared a sample as your requirement and updated the NavigationPage.TitleView using SelectionChanged event in SfTabView based on selection index using MVVM. We have used EventToCommand behaviour to bind the command in SelectionChanged event using MVVM. We have attached a sample for your reference which can be downloaded from the attachment.


 Please let us know if you need any other details.


Regards,

Shivani



Attachment: NavigationBarTabItem_66aaf0f9.zip


MC marcelo couto fernandes October 12, 2022 08:45 AM

Another point. If I need to Navigate to another Page, but letting the SfTabBar visible, how can I achieve it ? 
Because now if I do a Navigation.PushAsync, it navigates to another page with the NavBar visible, but the SfTabBar disappear.



SR Shivani Ramakrishnan Syncfusion Team October 13, 2022 08:25 AM

Hi Marcelo,



We have looked into your query. Since SfTabView is a ContentView control and not a Page control like TabbedPage,  navigating to another page won't show the TabView header in common for the navigated page.


So we regret to let you know that it is not possible to achieve this requirement currently with SfTabView.


Regards,

Shivani


Loader.
Live Chat Icon For mobile
Up arrow icon