Xamarin.Forms
Xamarin.Forms copied to clipboard
[Bug] Shell Tab Title property don't change value respect the binding declaration
Description
Can't bind the Shell Tab Tittle property to a ViewModel property.
Steps to Reproduce
I've made a GitHub project that repro the issue: ncarandini/XFShellBug
- Bind Title and Icon to VM properties:
<Shell.BindingContext>
<vm:AppShellViewModel/>
</Shell.BindingContext>
...
<Tab Title="{Binding LogInOutTitle}" Icon="{Binding LogInOutIconName}">
<ShellContent ContentTemplate="{DataTemplate views:LoginPage}" />
</Tab>
- Somehow change the values of
LogInOutTitleandLogInOutIconNameat runtime:
public string LogInOutTitle => !((App)Application.Current).IsUserLogged ? "Login" : "Logout";
public string LogInOutIconName => !((App)Application.Current).IsUserLogged ? "tab_login.png" : "tab_logout.png";
Expected Behavior
The Title and Icon of the Shell Tab element shall change following the XAML binding declaration.
Actual Behavior
The Icon changes accordingly but the Title don't.
Basic Information
- Xamarin.Forms: 4.6.0.800
Screenshots

Reproduction Link
I've made a GitHub project that repro the issue: ncarandini/XFShellBug
+1 It is impossible for us to apply our InApp Translation to the Shell because the Binding is defined as OneTime.
For the code in the repro you can set the Binding Mode to OneWay or TwoWay manually and then it works, i.e.:
<Tab Title="{Binding LogInOutTitle, Mode=OneWay}" Icon="{Binding LogInOutIconName}">
<ShellContent ContentTemplate="{DataTemplate views:LoginPage}" />
</Tab>
@jfversluis , If we bind the DataTemplate through binding in ContentTemplate and change the template at runtime, it is not updated. I looked into the source code and the PropertyChanged is not invoked for ContentTemplate bindable property and so it won't get update. Is there any way to update the new template at runtime?
Thanks