A simple Xamarin.Forms control to display a round badge
Now available on nuget! https://www.nuget.org/packages/BadgeView
Install-Package BadgeView
<ContentPage xmlns="http://xamarin.com/schemas/2014/forms" xmlns:badge="clr-namespace:BadgeView.Shared;assembly=BadgeView.Shared" xmlns:x="http://schemas.microsoft.com/winfx/2009/xaml" x:Class="BadgeViewExample.BadgePage">
<ContentPage.Content>
<StackLayout Orientation="Horizontal" HorizontalOptions="CenterAndExpand" VerticalOptions="Center">
<Label HorizontalTextAlignment="Center" Text="Look at me!" />
<badge:BadgeView Text="3" BadgeColor="Green" VerticalOptions="Center" HorizontalOptions="End" />
</StackLayout>
</ContentPage.Content>
</ContentPage>
<badge:BadgeView Text="{Binding BadgeNumber}" BadgeColor="{Binding BadgeColor}" VerticalOptions="Center" HorizontalOptions="End" />
var badge = new BadgeView()
{
Text = "4",
BadgeColor = Color.Red
};
Check out my blog post on how to build your own if you want! https://alexdunn.org/2017/03/15/xamarin-controls-badgeview/
- Add UWP Support