xabre / xamarin-forms-tab-badge

Xamarin Forms bindable Tab badges for iOS, Android, UWP, MacOS and WPF
MIT License
307 stars 75 forks source link

Badges no longer appear when content page is embedded in navigation page. #46

Closed Axemasta closed 6 years ago

Axemasta commented 6 years ago

I have come across an issue where the badges won't be displayed if the page displaying is embedded in a navigation page.

I am using prism for my app and got a demo project working perfectly, when I came to drop tab badge into my main app, I couldn't see any badges. I eventually tracked this issue down to 1 line of code, the navigation page. To demonstrate this issue I have recorded a little video of the bug in action (the password is "Xabre"). Hopefully this is helpful as I cannot share my source code and this should hopefully give you an insight into the issue.

As I said, my application is prism based however I cannot see this being an issue.

fsantanac commented 6 years ago

I have the same issue -:(

merickson91 commented 6 years ago

Any update on this? I am having the same issue.

xabre commented 6 years ago

I'll take a look as soon as possible. @Axemasta @fsantanac @merickson91 is iOS the only affected platform?

xabre commented 6 years ago

Seems related to #43, except that is a Android Non-AppCompat issue...

GalaxiaGuy commented 6 years ago

Do you mean you have TabbedPage -> NavgationPage -> ContentPage?

In that case, I believe the problem is the TabbedPage is trying to get the attached properties from the NavigationPage, when you have presumably defined them on the ContentPage.

One option which you can do as a consumer would be to bind the attached properties on the NavigationPage to its child.

The other option is to modify all the BadgedTabbedPageRenderers to check if the child Element is a NavigationPage, and in that case look at it's child.

Axemasta commented 6 years ago

@GalaxiaGuy So are you saying that the renderer is looking at the wrong view, when there is an embedded content page? I will have a look into this and report back!

GalaxiaGuy commented 6 years ago

I think that might be the problem...

However I've just realised that my suggestion about binding the attached properties won't work, since it seems you can't bind an attached property to an attached property on something else.

xabre commented 6 years ago

Pre-release with XF 3.1 android bottom tab placement suport is out:

https://www.nuget.org/packages/Plugin.Badge/2.1.0-pre.2

Please give it a try and let me know if you spot some problems.