I need to show some right-aligned toolbar item icon in this tab:
The icon is meant to represent the current user.
This menu comes from this code in appShell.xaml:
<Tab
x:Name="tabApprovals"
Title="{Binding LocalizationResourceManager[Approvals], Mode=OneWay}"
Icon="approvals"
IsVisible="{Binding TabApprovalsIsVisible}"
Shell.BackgroundColor="DarkSlateGray"
Shell.ForegroundColor="Firebrick">
<ShellContent
x:Name="Approvals"
Title="{Binding LocalizationResourceManager[Pending], Mode=OneWay}"
ContentTemplate="{DataTemplate Approvals:Approvals}"
Icon="approvals.svg"
Route="Approvals"
Shell.NavBarIsVisible="False"
Shell.TabBarTitleColor="#cd5c5c" />
<ShellContent
x:Name="Approved"
Title="{Binding LocalizationResourceManager[Finalized], Mode=OneWay}"
ContentTemplate="{DataTemplate ExpenseReports:Approved}"
Icon="approved.svg"
Route="Approved"
Shell.NavBarIsVisible="False"
Shell.TabBarTitleColor="#cd5c5c" />
</Tab>
On page “Approvals” I have added, as a test, this xaml code:
<ContentPage.ToolbarItems>
<ToolbarItem x:Name="logout_Icon" Command="{Binding LogoutCommand}">
<ToolbarItem.IconImageSource>
<FontImageSource
FontFamily="MaterialIconsOutlined-Regular"
Glyph=""
Size="20"
Color="Crimson" />
</ToolbarItem.IconImageSource>
</ToolbarItem>
</ContentPage.ToolbarItems>
and this glyph does NOT show ! However this exact same code, added in some other page in the app (which does NOT belong to appShell) shows just fine.
So adding the glyph this way does not work. There probably is some interference between the Shell and my <ContentPage.ToolbarItems> objects.
I have also tried to add my glyph in the section in AppShell, with code like
<ShellContent>
<ToolbarItem>
....
</ToolbarItem>
</ShellContent>
but that didn’t work either.
So my question is: How can I add a right-aligned “User” icon to all the tabs of this application ?
Thank you very much. Alex.
2