dewango/BottomNavigationBarXF

CurrentPageChanged event is not fired

Closed this issue · 6 comments

I can't simply do this inside BottomBar Page

this.CurrentPageChanged += async (object sender, EventArgs e) =>
            {
                if (!AppSettings.IsLogged)
                {
                    await Navigation.PushAsync(new Welcome(), false);
                    return;
                }
            };

This method:

https://github.com/thrive-now/BottomNavigationBarXF/blob/master/BottomBar.Droid/Renderers/BottomBarPageRenderer.cs#L161

needs to call tell Element property (which is the XamarinForms BottomBar) to raise CurrentPageChanged event (BottomBar is derived from MultiPage), something like this:

Element.RaiseCurrentPageChanged()

or something similar...

a PR would be welcome :)

+1
Any news ?

From what I understand, it seems that Xamarin Forms TabbedPage control lacks a virtual OnCurrentPageChanged method that can be overriden and called from the renderer.

Update: Err... forget this comment, didn't look at it hard enough ;)
See final solution in PR below.

Ok I have a fix for this.
I'll do the PR tomorrow.

There you go. PR #15.

PR merged