-
Notifications
You must be signed in to change notification settings - Fork 0
NullOrEmptyBooleanConverter
Mark Smith edited this page Aug 26, 2016
·
2 revisions
This value converter takes an input object or string and returns a boolean value based on whether the input is null/empty.
This can be used inline with a binding, or if you want to reuse the object, you can place it into a resource dictionary.
-
Empty: the boolean value to return if the input is null/empty. Defaults to `false'. -
NotEmpty: the boolean value to return if the input has a value. Defaults to `true'.
<Entry x:Name="nameEntry" Text="{Binding Name, Mode=TwoWay}" />
<Label TextColor="Red" Text="You must supply a name"
IsVisible="{Binding Name,
Converter={cvt:NullOrEmptyBooleanConverter Empty=true, NotEmpty=false}}" />