-
Notifications
You must be signed in to change notification settings - Fork 4
Value Converters
Value converters are methods that you can use to bind data to views, but in the format that the views natively don't understand so they cannot be bound directly.
There are currently two value converters in the library:
-
ToFont
converter, that sets the customTypeface
to theView
(but you have to add fonts to the assets and register them with theFontManager
- detailed guide here) -
ToVisibility
converters, that converts aBoolean
into aView.VISIBILITY
, enabling you to bind aBoolean
directly to theVisibility
property of aView
. It is used like this:{Visibility @= ToVisibility(ViewVisible)}
, whereToVisibility
is the converter's name and theViewVisible
is the name of the bound data or method (with addedget
prefix, so it becomesgetViewVisible
). You can also see the example code.