Binding to TabbedPage tabs titles

ReedReed Member ✭✭
edited January 22 in Xamarin.Forms

I have a TabbedPage with two tabs. One tab is for read and the other tab is for unread messages. Titles of tabs should be bound to the count of messages. Both pages have a refresh button and when the button is clicked I want update both tabs title values.

I've tried to implement this by assigning the TabbedPage BindingContext to the CurrentPage BindingContext in the TabbedPage code behind and I bind the Titles of tabs as shown in the example:

<TabbedPage xmlns=""
    <local:ReadMessages Title="{Binding Message.ReadMessagesCount}" />
    <local:UndreadMessages Title="{Binding Message.UnreadMessagesCount}" />       

The issue is when the refresh button is clicked, it updates the property that both titles are bound to, but only the title of the page that I'm currently in actually changes. For example, if I'm in ReadMessages and I hit the refresh button, only the ReadMessages tab's title is updated. It seems like it binds only to the active page.

How can I solve this issue?


Sign In or Register to comment.