Quantcast
Channel: Xamarin.Forms — Xamarin Community Forums
Viewing all articles
Browse latest Browse all 91519

How to remove a tab dynamically

$
0
0

I have this tabbedpage:

<TabbedPage xmlns="http://xamarin.com/schemas/2014/forms"
            xmlns:x="http://schemas.microsoft.com/winfx/2009/xaml"
            xmlns:prism="clr-namespace:Prism.Mvvm;assembly=Prism.Forms"
            prism:ViewModelLocator.AutowireViewModel="True"
            x:Class="AppAlgorix.Views.TabbedDescriptionPage"
            xmlns:local="clr-namespace:AppAlgorix.Views"
            Title="Detalhes do Cartão">
    <TabbedPage.Children>
        <local:InvoicesPage Title="Faturas" Icon="ic_attach_money_white_18dp.png" IsVisible="{Binding InvoicesVisible}" />
        <local:LastEntriesPage Title="Lançamentos" Icon="ic_view_list_white_18dp.png" IsVisible="{Binding LastEntriesVisible}" />
        <local:PointsPage Title="Pontos" Icon="ic_numeric_white_18dp.png" IsVisible="{Binding PointsVisible}" />
    </TabbedPage.Children>
</TabbedPage>

Sometimes I will need to turns invisible the second and third tabs.

I tried to get the event OnNavigatedTo, but I saw its never fired in tabbed page.

I need to remove one tab or another, before the user sees the tabbed page as well.

There is the attribute IsVisible on each child page, so I think is possible to turns a tab invisible programatically, but I dont know how...

How to do that ?

Thanks.


Viewing all articles
Browse latest Browse all 91519

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>