TemplConverters 1.0.1
See the version list below for details.
dotnet add package TemplConverters --version 1.0.1
NuGet\Install-Package TemplConverters -Version 1.0.1
<PackageReference Include="TemplConverters" Version="1.0.1" />
paket add TemplConverters --version 1.0.1
#r "nuget: TemplConverters, 1.0.1"
// Install TemplConverters as a Cake Addin #addin nuget:?package=TemplConverters&version=1.0.1 // Install TemplConverters as a Cake Tool #tool nuget:?package=TemplConverters&version=1.0.1
TemplConverters
TempleConverters is a Class Library containing common Value Converters for use in Xamarin.Forms projects.
Common converters contained in this package include:
- InverseBoolConverter
- StringIsNullOrEmptyToBoolConverter
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 | Versions 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. net9.0 was computed. net9.0-android was computed. net9.0-browser was computed. net9.0-ios was computed. net9.0-maccatalyst was computed. net9.0-macos was computed. net9.0-tvos was computed. net9.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. |
-
.NETStandard 2.0
- Xamarin.Forms (>= 4.8.0.1451)
NuGet packages
This package is not used by any NuGet packages.
GitHub repositories
This package is not used by any popular GitHub repositories.
Common converters contained in this package:
-StringIsNullOrEmptyToBoolConverter
-InverseBoolConverter