Skip to content

Commit

Permalink
Fixed the empty badge appearing (#291)
Browse files Browse the repository at this point in the history
* Fix the issue

* Resolve the comments

* Resolve comments

Co-authored-by: Adhithya Manthrirathne <Adhithya@CreativeSoftware.com>
Co-authored-by: Rizan Zaky <rizanzaky@users.noreply.github.com>
  • Loading branch information
3 people authored Sep 21, 2021
1 parent 9a1cac5 commit aae5ed0
Showing 1 changed file with 13 additions and 2 deletions.
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Windows.Input;
using DIPS.Xamarin.UI.Controls.Modality;
using Xamarin.Forms;
Expand Down Expand Up @@ -96,8 +97,18 @@ private static void IsVisiblePropertyChanged(BindableObject bindable, object old
{
if (bindable is FloatingActionMenuBehaviour behaviour)
{
behaviour.Children.ForEach(mb => mb.IsVisible = (bool) newvalue);
behaviour.Children.ForEach(mb => mb.IsBadgeVisible = (bool)newvalue);
behaviour.Children.ForEach(mb => mb.IsVisible = (bool)newvalue);

var menuButtons = behaviour.Children.FindAll(mb => !string.IsNullOrEmpty(mb.BadgeCount));

if (!(bool)newvalue)
{
behaviour.Children.ForEach(mb => mb.IsBadgeVisible = false);
}
else
{
menuButtons.ForEach(mb => mb.IsBadgeVisible = true);
}
}
}

Expand Down

0 comments on commit aae5ed0

Please sign in to comment.