Converters for Xamarin.Forms
| Name | Input type | Output type |
|---|---|---|
| InverseBoolConverter | bool |
bool |
| IsEmptyConverter | string |
bool |
| IsEmptyCollectionConverter | ICollection |
bool |
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" />Multiple converters with ValueConverterGroup:
<converters:ValueConverterGroup x:Key="IsEmptyInverse">
<converters:IsEmptyConverter />
<converters:InverseBoolConverter />
</converters:ValueConverterGroup>© 2016 Yauheni Pakala | MIT