Navigation Menu

Skip to content

Instantly share code, notes, and snippets.

@juucustodio
Created January 8, 2018 15:59
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save juucustodio/4ea71f5523a2c0829afca7d6b225be75 to your computer and use it in GitHub Desktop.
Save juucustodio/4ea71f5523a2c0829afca7d6b225be75 to your computer and use it in GitHub Desktop.
ButtonWithBadge
<?xml version="1.0" encoding="utf-8" ?>
<ContentPage xmlns="http://xamarin.com/schemas/2014/forms"
xmlns:x="http://schemas.microsoft.com/winfx/2009/xaml"
xmlns:local="clr-namespace:BadgeView"
x:Class="BadgeView.MainPage">
<ContentPage.Content>
<StackLayout BackgroundColor="DarkGray"
HeightRequest="35" VerticalOptions="Center">
<StackLayout.GestureRecognizers>
<TapGestureRecognizer Tapped="AddNotification"/>
</StackLayout.GestureRecognizers>
<StackLayout Orientation="Horizontal" HorizontalOptions="Center" VerticalOptions="Center">
<Label HorizontalTextAlignment="Center" Text="Notifications" FontSize="18" TextColor="White"/>
<local:Badge x:Name="BadgeNotifications" BoxColor="red"
WidthRequest="18" HeightRequest="18"
VerticalOptions="Center" HorizontalOptions="Center">
<x:Arguments>
<x:Double>30</x:Double>
<x:Double>10</x:Double>
</x:Arguments>
</local:Badge>
</StackLayout>
</StackLayout>
</ContentPage.Content>
</ContentPage>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment