We use cookies to give you the best experience on our website. If you continue to browse, then you agree to our privacy policy and cookie policy. (Last updated on: June 24, 2019).
Unfortunately, activation email could not send to your email. Please try again.
Syncfusion Feedback

Badge conditional visibility

Thread ID:

Created:

Updated:

Platform:

Replies:

150875 Jan 22,2020 06:23 PM UTC Jan 23,2020 09:02 AM UTC Xamarin.Forms 1
loading
Tags: SfBadgeView
David Brenchley
Asked On January 22, 2020 06:23 PM UTC

How do I make the visibility of the badge itself conditional?  When I bind to the IsVisible property on the badgeview, the whole badge content becomes hidden.  I just want to hide the badge itself, such as for a selected item in a list.

Ramya Soundar Rajan [Syncfusion]
Replied On January 23, 2020 09:02 AM UTC

Hi David, 
 
Thanks for contacting Syncfusion support. 
 
You can achieve this requirement in two ways. 
 
To hide the Badge, you can set empty string to BadgeText property as shown in the below code.  
 
        <badge:SfBadgeView BadgeText="" HorizontalOptions="Center" VerticalOptions="Center" Grid.Column="0"> 
            <badge:SfBadgeView.Content> 
                <Button Text="Primary" WidthRequest="120" HeightRequest="60"/> 
            </badge:SfBadgeView.Content> 
        </badge:SfBadgeView> 
 
Another way to hide the Badge, by setting the BadgeIcon property as None without specifying the BadgeText as shown in the below code.  
 
Note: By default, BadgeIcon value is None.  
 
            <badge:SfBadgeView.BadgeSettings> 
                <badge:BadgeSetting BadgeIcon="None"  BadgePosition="TopRight"/> 
            </badge:SfBadgeView.BadgeSettings> 
 
We have created a simple sample to change the visibility of Badge. Please find the sample from below location. 
 
 
Output Screenshot: 
 
 
 
Regards, 
Ramya. 


CONFIRMATION

This post will be permanently deleted. Are you sure you want to continue?

Sorry, An error occured while processing your request. Please try again later.

Please sign in to access our forum

This page will automatically be redirected to the sign-in page in 10 seconds.

Warning Icon You are using an outdated version of Internet Explorer that may not display all features of this and other websites. Upgrade to Internet Explorer 8 or newer for a better experience.Close Icon

Live Chat Icon For mobile
Live Chat Icon