Xamarin.Forms Shell has an IsVisible
property you can use to show and hide pages in a flyout or tab bar, and control if those pages are routable based on any criteria such as authorization role.
<TabBar Route="main"> | |
<Tab Title="Browse" Icon="tab_feed.png"> | |
<ShellContent | |
ContentTemplate="{DataTemplate local:ItemsPage}" /> | |
</Tab> | |
<Tab Title="About" Icon="tab_about.png"> | |
<ShellContent | |
ContentTemplate="{DataTemplate local:AboutPage}" /> | |
</Tab> | |
<Tab Title="Admin" IsVisible="{Binding IsAdmin}"> | |
<ShellContent | |
ContentTemplate="{DataTemplate local:AdminPage}"/> | |
</Tab> | |
</TabBar> |
Top comments (1)
when i tried to apply the same logic to flyoutitem, the IsAdmin value always returns false for some reason. I have tried placing breakpoints during debugging and the value on the code behind was true before being pushed into the page. Any idea what did i do wrong?
my modified code: dev-to-uploads.s3.amazonaws.com/up...