Skip to content

Latest commit

 

History

History
46 lines (34 loc) · 1001 Bytes

README.md

File metadata and controls

46 lines (34 loc) · 1001 Bytes

XForms.Converters

Converters for Xamarin.Forms

Name Input type Output type
InverseBoolConverter bool bool
IsEmptyConverter string bool
IsEmptyCollectionConverter ICollection bool

How to use

Add namespace on your page:

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

Add converters to resources:

<ResourceDictionary>

	<!-- Converters -->
	<converters:InverseBoolConverter x:Key="InverseBool" />
	<!-- ... -->
	
</ResourceDictionary>

Use on page:

<Label IsVisible="{Binding IsEnabled, Converter={StaticResource InverseBool}}" Text="XForms" />

Additional features

Multiple converters with ValueConverterGroup:

<converters:ValueConverterGroup x:Key="IsEmptyInverse">
	<converters:IsEmptyConverter />
	<converters:InverseBoolConverter />
</converters:ValueConverterGroup>

© 2016 Yauheni Pakala | MIT