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

BadgeCount throwing error #89

Open
ghost opened this issue Dec 29, 2017 · 9 comments
Open

BadgeCount throwing error #89

ghost opened this issue Dec 29, 2017 · 9 comments

Comments

@ghost
Copy link

ghost commented Dec 29, 2017

Cannot assign property "BadgeCount": Property does not exists, or is not assignable, or mismatching type between value and property.

@jonathan-jd4software
Copy link

I have the same issue, no access to BadgeCount or BadgeColor.

@C0D3On3
Copy link

C0D3On3 commented Feb 6, 2018

All,

The changes were committed but the nuget package containing those changes were never released hence why you can't see those properties. To use, download source, build a release and package a local nuget file with the changes and consume that in your project. That'll do the trick.

@jonathan-jd4software
Copy link

Thanks for the information @RyanJosephVI. An update to the nuget package at some time, would be great for the community; it might save you from lots of messages too.

@C0D3On3
Copy link

C0D3On3 commented Feb 6, 2018

Sure thing @jonathan-jd4software I agree a new nuget package would be great but I'm not the project owner. Just a community member like yourself sharing how I got around this issue.

@jonathan-jd4software
Copy link

Sorry @RyanJosephVI my mistake :)

@mario-velasco
Copy link

Hi there, I update BottomNavigationBar, Xamarin.Forms and change the pcl to netstandard and fix the issue!

mario-velasco added a commit to mario-velasco/BottomNavigationBarXF that referenced this issue Mar 16, 2018
@shivanimangla13
Copy link

Add custom renderer for iOS. It worked for me :) .

"using System;
using BottomBar.XamarinForms;
using Xamarin.Forms;
using Xamarin.Forms.Platform.iOS;
using SchoolApp.iOS;
using System.ComponentModel;

[assembly: ExportRenderer(typeof(BottomBarPage), typeof(BottomBarPageRenderer))]
namespace SchoolApp.iOS
{
class BottomBarPageRenderer : TabbedRenderer
{

protected override void OnElementChanged(VisualElementChangedEventArgs e)
{
base.OnElementChanged(e);

if (e.NewElement != null)
{
    BottomBarPage bottomBarPage = e.NewElement as BottomBarPage;
    AddPropertyChangedHandlersForPages();
}

}

void AddPropertyChangedHandlersForPages()
{
BottomBarPage bottomBarPage = Element as BottomBarPage;
foreach (var page in bottomBarPage.Children)
{
page.PropertyChanged += OnPagePropertyChanged;
UpdateTabBadge(page);
}
}
public override void ViewWillAppear(bool animated)
{
base.ViewWillAppear(animated);

BottomBarPage bottomBarPage = Element as BottomBarPage;
foreach (var page in bottomBarPage.Children)
{
    UpdateTabBadge(page);
}

}

void OnPagePropertyChanged(object sender, PropertyChangedEventArgs e)
{
if (e.PropertyName == BottomBarPageExtensions.BadgeCountProperty.PropertyName)
{
UpdateTabBadge((Page)sender);
}
}
private void UpdateTabBadge(Page page)
{
if (TabBar != null && TabBar.Items != null)
{
var badgeCount = BottomBarPageExtensions.GetBadgeCount(page);
var tabIndex = Tabbed.Children.IndexOf(page);
TabBar.Items[tabIndex].BadgeValue = (badgeCount == 0 ? null : badgeCount.ToString());
}
}
}
}

image

@Phenek
Copy link

Phenek commented Oct 26, 2018

Hey People no Solid answer here!
Maybe you already known? But with Xamarin.Forms 3.x you can put the Android Tabbed page at the Bottom and it's official!

I found this https://montemagno.com/xamarin-forms-official-bottom-navigation-bottom-tabs-on-android/

And the Xabre's Tab Badge Library , they did a Pre-release 2.1.0-pre.3 to support badges on it

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

6 participants
@Phenek @jonathan-jd4software @mario-velasco @C0D3On3 @shivanimangla13 and others