All Projects → xabre → Xamarin Forms Tab Badge

xabre / Xamarin Forms Tab Badge

Licence: mit
Xamarin Forms bindable Tab badges for iOS, Android, UWP, MacOS and WPF

Projects that are alternatives of or similar to Xamarin Forms Tab Badge

Arcgis Runtime Samples Dotnet
Sample code for ArcGIS Runtime SDK for .NET – UWP, WPF, Xamarin.Android, Xamarin.iOS, and Xamarin.Forms
Stars: ✭ 274 (-9.87%)
Mutual labels:  uwp, xamarin-android, xamarin-ios, wpf, xamarin-forms
Mvvmlight
The main purpose of the toolkit is to accelerate the creation and development of MVVM applications in Xamarin.Android, Xamarin.iOS, Xamarin.Forms, Windows 10 UWP, Windows Presentation Foundation (WPF), Silverlight, Windows Phone.
Stars: ✭ 973 (+220.07%)
Mutual labels:  uwp, xamarin-android, xamarin-ios, wpf, xamarin-forms
Arcgis Toolkit Dotnet
Toolkit for ArcGIS Runtime SDK for .NET
Stars: ✭ 125 (-58.88%)
Mutual labels:  uwp, xamarin-android, xamarin-ios, wpf, xamarin-forms
Microsoft.maui.graphics
Stars: ✭ 160 (-47.37%)
Mutual labels:  uwp, xamarin-android, xamarin-ios, wpf, xamarin-forms
arcgis-runtime-demos-dotnet
Demo applications provided by the ArcGIS Runtime SDK for .NET Team
Stars: ✭ 51 (-83.22%)
Mutual labels:  uwp, wpf, xamarin-forms, xamarin-ios, xamarin-android
Xaml Code Experiences
A collection of the experiences I have collected during days of Xamarin and Wpf, while following the MVVM design pattern.
Stars: ✭ 114 (-62.5%)
Mutual labels:  xamarin-android, xamarin-ios, wpf, xamarin-forms
Open Source Xamarin Apps
📱 Collaborative List of Open Source Xamarin Apps
Stars: ✭ 318 (+4.61%)
Mutual labels:  uwp, xamarin-android, xamarin-ios, xamarin-forms
Faceoff
An iOS, Android and UWP app created in Xamarin.Forms that uses Microsoft's Cognitive Emotion API Services to compare facial expressions
Stars: ✭ 79 (-74.01%)
Mutual labels:  uwp, xamarin-android, xamarin-ios, xamarin-forms
Ffimageloading
Image loading, caching & transforming library for Xamarin and Windows
Stars: ✭ 1,288 (+323.68%)
Mutual labels:  uwp, xamarin-android, xamarin-ios, xamarin-forms
Simpleauth
The Simplest way to Authenticate and make Rest API calls in .Net
Stars: ✭ 148 (-51.32%)
Mutual labels:  uwp, xamarin-android, xamarin-ios, xamarin-forms
Inthehand.forms
Extras for Xamarin Forms including MediaElement
Stars: ✭ 68 (-77.63%)
Mutual labels:  uwp, xamarin-android, xamarin-ios, xamarin-forms
Connectivityplugin
Connectivity Plugin for Xamarin and Windows
Stars: ✭ 253 (-16.78%)
Mutual labels:  uwp, xamarin-android, xamarin-ios, xamarin-forms
Plugin.audiorecorder
Audio Recorder plugin for Xamarin and Windows
Stars: ✭ 140 (-53.95%)
Mutual labels:  uwp, xamarin-android, xamarin-ios, xamarin-forms
Xamarin Demos
This repository contains the Syncfusion Xamarin UI control’s samples and the guide to use them.
Stars: ✭ 218 (-28.29%)
Mutual labels:  uwp, xamarin-android, xamarin-ios, xamarin-forms
LaunchMapsPlugin
Launch External Maps Plugin for Xamarin and Windows
Stars: ✭ 49 (-83.88%)
Mutual labels:  uwp, xamarin-forms, xamarin-ios, xamarin-android
XamarinAzureChallenge
Create an iOS/Android app using Xamarin.Forms and connect it to a serverless Azure Function
Stars: ✭ 59 (-80.59%)
Mutual labels:  xamarin-forms, xamarin-ios, xamarin-android
vs-material-icons-generator
This plugin will help you to set material design icons to your Xamarin projects In Visual Studio.
Stars: ✭ 50 (-83.55%)
Mutual labels:  uwp, xamarin-ios, xamarin-android
DevOpsExamples
A repo to show you how to use a private NuGet feed, such as Telerik, to restore packages in Azure DevOps, GitHub Actions, GitLab CI and AppCenter.
Stars: ✭ 16 (-94.74%)
Mutual labels:  uwp, wpf, xamarin-forms
XamarinClipboardPlugin
Cross Platform Clipboard access for Xamarin
Stars: ✭ 24 (-92.11%)
Mutual labels:  xamarin-forms, xamarin-ios, xamarin-android
DarkModeSplashScreen
A sample app for iOS and Android written in Xamarin.Forms showing how to implement a Splash Page for Dark Mode
Stars: ✭ 28 (-90.79%)
Mutual labels:  xamarin-forms, xamarin-ios, xamarin-android

xamarin-forms-tab-badge Build Status

Xamarin Forms bindable tab badges for iOS, Android, UWP, MacOS and WPF. The plugin creates a custom renderer (for each platform) and a custom attached property for adding tab bar badges which can be bound in XF shared code.

Sample

Support & Limitations

Feature / Availability Xamarin.Android (1) Xamarin.iOS UWP (2) MacOS (3) WPF (4)
Bindable Badge Text ✓ (>=8.0)
Bindable Badge Color ✓ (>= 10.0)
Bindable Badge Text Color ✓ (>= 10.0)
Bindable Badge Font ✓* ✓ *(>= 10.0)
Bindable Badge Postion
Bindable Badge Margin
Dynamic tab add/removal No overflow

*(1) Min Android API level 15, bottom placement also supported starting with v2.1.0

*(2) Min UWP version: Win 10 Fall Creators Update (XF.3 has a .netstandard 2 requirement).

*(3) MacOS version: -

*(4) WPF version: -

**Font restrictions: able to bind font attributes and family but not size

Installation

  • Make sure to install the package in your Xamarin.Forms shared/core project as well as a platform specifc projects.
// stable
Install-Package Plugin.Badge
// or pre-release
Install-Package Plugin.Badge -Pre

NuGet NuGet Beta

iOS, Android, UWP, MacOS, WPF

You have to register the custom renderer. I usually put this in the AssemblyInfo.cs file of my Platform specific project (iOS, Android, UWP, MacOS, WPF) csproj.

[assembly: ExportRenderer(typeof(TabbedPage), typeof(BadgedTabbedPageRenderer))]

Caution: If you are using the NON AppCompat MainActivity (i.e. you Main activity inherits from FormsApplicationActivity) please register the 'Legacy' renderer

[assembly: ExportRenderer(typeof(TabbedPage), typeof(LegacyBadgedTabbedRenderer))]

Caution - Custom TabbedPage / Custom Renderers

If you are using a custom renderer for TabbedPage please change it to inherit from BadgedTabbedPageRenderer and you are all set. Of course dont forget to register your own renderer.

Linker

As you already know when you enable linkling for your application the linker might remove some of the methods/types/properties/events used by third party libraries. This is why it's necessary to update your LinkerPleaseInclude.cs. Check this blogpost for more linker info.

  • For iOS add the following lines:
public void Include(UITabBarItem item)
{
    item.BadgeColor = UIColor.Red;
    item.BadgeValue = "badge";
}
  • For Android no issues detected yet :). Feel free to report any issues here.

Usage

Badge Text

For each child page of the TabbedPage just bind the custom attached property [TabBadge.BadgeText (XAML) or TabBadge.BadgeTextPropery (CSharp)]

XAML

The important line here is binding the attached property:

  plugin:TabBadge.BadgeText="{Binding Count}"

Example tabbed page with badged children:

<TabbedPage xmlns="http://xamarin.com/schemas/2014/forms"
             xmlns:x="http://schemas.microsoft.com/winfx/2009/xaml"
             xmlns:plugin="clr-namespace:Plugin.Badge.Abstractions;assembly=Plugin.Badge.Abstractions" 
             x:Class="Plugin.Badge.Sample.TabXaml">
  <TabbedPage.Children>
    <ContentPage Title="Tab1" 
                 Icon="icontab1.png"
                 plugin:TabBadge.BadgeText="{Binding Count}">
      <StackLayout>...</StackLayout>
    </ContentPage>
    ...
  </TabbedPage.Children>
</TabbedPage>

CSharp codebehind

var tab1 = new ContentPage //assume this is a child page of your Tab
{
    Title = "Tab1",
    Content = tab1Layout
};

tab1.SetBinding(TabBadge.BadgeTextProperty, new Binding("Count"));

Badge Color

Very similar to BadgeText just use [TabBadge.BadgeColor (XAML) or TabBadge.BadgeColorPropery (CSharp)].

Badge Text Color

Very similar to BadgeColor just use [TabBadge.BadgeTextColor (XAML) or TabBadge.BadgeTextColorPropery (CSharp)].

Badge Font Attributes

Very similar to BadgeColor just use [TabBadge.BadgeFont (XAML) or TabBadge.BadgeFontPropery (CSharp)].

ToDo:

  • you can alo try to set font family, should work in theory
  • font size is not supported yet on android ......

Badge Position

Very similar to BadgeColor just use [TabBadge.BadgePosition (XAML) or TabBadge.BadgePositionPropery (CSharp)].

TopLeft BottomLeft BottomRight Center TopCenter BottomCenter LeftCenter RightCenter

Showning / Hiding the badge

If the value of the BadgeText is set to null or empty string the badge is hidden. To show it again set a non null or empty value

Generic Badge View

As of v2.2.0 the package also contains a XF Badge view that is based on a XF Frame View and can be added to any layout and bound using the usual approach. The generic badge view can also be added to custom NavigationPage.TitleView layouts.

Checkout the Sample-App for more.

Licence

MIT

Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].
OSZAR »