Home

Awesome

Xamarin.Forms.ConvertersPack

Package with multiple converters for Xamarin.Forms.

This is the component, works on iOS, Android and UWP.

NuGet

NameInfo
Xamarin.Forms.ConvertersPackNuGet

Platform Support

Xamarin.Forms.ConvertersPack is a .NET Standard 2.0 library.Its only dependency is the Xamarin.Forms

Setup / Usage

Does not require additional configuration. Just install the package in the shared project and use.

You just need to add the reference in your xaml file.

    xmlns:converterPack="clr-namespace:Xamarin.Forms.ConvertersPack;assembly=Xamarin.Forms.ConvertersPack"
     <ContentPage.Resources>
        <ResourceDictionary>
         <converterPack:CurrencyConverter x:Key="CurrencyConverter" />
         <converterPack:UpperTextConverter x:Key="UpperTextConverter" />
        <converterPack:LowerTextConverter x:Key="LowerTextConverter" />
        </ResourceDictionary>
    </ContentPage.Resources>
    
    <StackLayout>

         <Label Text="Enter your name"></Label>
        
         <Entry Placeholder="Your name" Text="{Binding Name}"></Entry>
        
         <Label Text="{Binding Name, Converter={StaticResource UpperTextConverter}}"></Label>
        
         <Label Text="{Binding Name, Converter={StaticResource LowerTextConverter}}"></Label>
        
         <Label Text="Enter your balance"></Label>
        
         <Entry Placeholder="Money" 
              Keyboard="Numeric" 
              Text="{Binding Money, Converter={StaticResource CurrencyConverter}}"></Entry>
        
    </StackLayout>

Available Converters

The complete example can be downloaded here: https://github.com/TBertuzzi/Xamarin.Forms.ConvertersPack/tree/master/ConvertersPackSample