Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Badge is not visible when i add a renderer to navigate to root page on tab reselected #92

Open
kamranmasud opened this issue Jul 8, 2020 · 0 comments

Comments

@kamranmasud
Copy link

I want to show badge on cart tab..on the other side i want to show root page on tab clicked or reselected..I am using your plugin to show badge on tab but when i use renderer to show root page on tab reselected then badge is not visible. I am finding the solution because i want both of these functionalities in my app..
I am using the following renderer to navigate to root page when i reselect tab:

[assembly: ExportRenderer(typeof(TabPage), typeof(MainPageRenderer))]
namespace MyProject.Droid.Renderers
{
public class MainPageRenderer : TabbedPageRenderer, TabLayout.IOnTabSelectedListener
{
private TabPage _page;
protected override void OnElementChanged(ElementChangedEventArgs e)
{
base.OnElementChanged(e);
if (e.NewElement != null)
{
_page = (TabPage)e.NewElement;
}
else
{
_page = (TabPage)e.OldElement;
}

    }
    async void TabLayout.IOnTabSelectedListener.OnTabReselected(TabLayout.Tab tab)
    {
        await _page.CurrentPage.Navigation.PopToRootAsync();
    }
}

}

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant