TemplConverters 1.0.6

dotnet add package TemplConverters --version 1.0.6
NuGet\Install-Package TemplConverters -Version 1.0.6
This command is intended to be used within the Package Manager Console in Visual Studio, as it uses the NuGet module's version of Install-Package.
<PackageReference Include="TemplConverters" Version="1.0.6" />
For projects that support PackageReference, copy this XML node into the project file to reference the package.
paket add TemplConverters --version 1.0.6
#r "nuget: TemplConverters, 1.0.6"
#r directive can be used in F# Interactive and Polyglot Notebooks. Copy this into the interactive tool or source code of the script to reference the package.
// Install TemplConverters as a Cake Addin
#addin nuget:?package=TemplConverters&version=1.0.6

// Install TemplConverters as a Cake Tool
#tool nuget:?package=TemplConverters&version=1.0.6

TemplConverters

TempleConverters is a Class Library containing common Value Converters for use in Xamarin.Forms projects.

Common converters contained in this package include:

  • InverseBoolConverter
  • NumberEqualToZeroConverter
  • NumberGreaterThanOrEqualToZeroConverter
  • NumberGreaterThanZeroConverter
  • NumberLessThanOrEqualToZeroConverter
  • NumberLessThanOrZeroConverter
  • StringIsNullOrEmptyToBoolConverter
  • StringLengthEqualsIntConverter
  • StringLengthGreaterThanIntConverter
  • StringLengthGreaterThanOrEqualToIntConverter
  • StringLengthLessThanIntConverter
  • StringLengthLessThanOrEqualToIntConverter
  • StringsMatchConverter

Installation

To add the library to your Xamarin.Forms project, you can use NuGet with the following package:

PM> Install-Package TemplConverters

You should only have to install the package to your shared codebase project (e.g. YourProject.Shared).

Usage

Once you have the Nuget package installed, you can reference it in your XAML pages by adding the following code at the top of the .xaml page:

xmlns:converters="clr-namespace:Templ.Converters;assembly=Templ.Converters" 

Add a ResourceDictionary to the page that contains a reference to the Converter you wish to use:

<ContentPage.Resources>
        <ResourceDictionary>
            <converters:StringIsNullOrEmptyToBoolConverter x:Key="StringIsNullOrEmpty/>
        </ResourceDictionary>
</ContentPage.Resources>

You can now reference the Converter resource in a XAML control like this:

<Label Text="{Binding Message}"
       IsVisible="{Binding Message, Converter={StaticResource StringIsNullOrEmpty}}"/>

If you want to be able to reference Converters from the library in any page in your project, simply add the reference to your App.xaml page like so:

<?xml version="1.0" encoding="utf-8" ?>
<Application xmlns="http://xamarin.com/schemas/2014/forms"
             xmlns:x="http://schemas.microsoft.com/winfx/2009/xaml"
             xmlns:d="http://xamarin.com/schemas/2014/forms/design"
             xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
             xmlns:converters="clr-namespace:Templ.Converters;assembly=Templ.Converters" 
             mc:Ignorable="d"
             x:Class="YourProject.App">
    <Application.Resources>
        <ResourceDictionary>
            <converters:InverseBoolConverter x:Key="InverseBool" />
            <converters:StringIsNullOrEmptyToBoolConverter x:Key="StringIsNullOrEmpty" />
        </ResourceDictionary>
    </Application.Resources>
</Application>
Product Compatible and additional computed target framework versions.
.NET net5.0 was computed.  net5.0-windows was computed.  net6.0 was computed.  net6.0-android was computed.  net6.0-ios was computed.  net6.0-maccatalyst was computed.  net6.0-macos was computed.  net6.0-tvos was computed.  net6.0-windows was computed.  net7.0 was computed.  net7.0-android was computed.  net7.0-ios was computed.  net7.0-maccatalyst was computed.  net7.0-macos was computed.  net7.0-tvos was computed.  net7.0-windows was computed.  net8.0 was computed.  net8.0-android was computed.  net8.0-browser was computed.  net8.0-ios was computed.  net8.0-maccatalyst was computed.  net8.0-macos was computed.  net8.0-tvos was computed.  net8.0-windows was computed. 
.NET Core netcoreapp2.0 was computed.  netcoreapp2.1 was computed.  netcoreapp2.2 was computed.  netcoreapp3.0 was computed.  netcoreapp3.1 was computed. 
.NET Standard netstandard2.0 is compatible.  netstandard2.1 was computed. 
.NET Framework net461 was computed.  net462 was computed.  net463 was computed.  net47 was computed.  net471 was computed.  net472 was computed.  net48 was computed.  net481 was computed. 
MonoAndroid monoandroid was computed. 
MonoMac monomac was computed. 
MonoTouch monotouch was computed. 
Tizen tizen40 was computed.  tizen60 was computed. 
Xamarin.iOS xamarinios was computed. 
Xamarin.Mac xamarinmac was computed. 
Xamarin.TVOS xamarintvos was computed. 
Xamarin.WatchOS xamarinwatchos was computed. 
Compatible target framework(s)
Included target framework(s) (in package)
Learn more about Target Frameworks and .NET Standard.

NuGet packages

This package is not used by any NuGet packages.

GitHub repositories

This package is not used by any popular GitHub repositories.

Version Downloads Last updated
1.0.6 353 4/13/2021
1.0.5 342 2/10/2021
1.0.4 448 10/19/2020
1.0.3 376 10/13/2020
1.0.2 377 10/13/2020
1.0.1 434 10/7/2020
1.0.0 437 10/7/2020

New in this version:
-ComplimentaryColorConverter
-DarkOrLightColorConverter

Common converters contained in this package:
- InverseBoolConverter
- NumberEqualToZeroConverter
- NumberGreaterThanOrEqualToZeroConverter
- NumberGreaterThanZeroConverter
- NumberLessThanOrEqualToZeroConverter
- NumberLessThanOrZeroConverter
- StringIsNullOrEmptyToBoolConverter
- StringLengthEqualsIntConverter
- StringLengthGreaterThanIntConverter
- StringLengthGreaterThanOrEqualToIntConverter
- StringLengthLessThanIntConverter
- StringLengthLessThanOrEqualToIntConverter
- StringsMatchConverter