!
.Convert.ToBoolean
and the result from this is negated. Because the integer value 0
is considered false
and all other integer values are considered true
, you can use this to show a message when a collection is empty:Note: TheIValueConverter
interface is not available in .NET standard 2.0 so we ship our own, in theAvalonia.Data.Converters
namespace.
StringConverters.IsNullOrEmpty
true
if the input string is null or emptyStringConverters.IsNotNullOrEmpty
false
if the input string is null or emptyObjectConverters.IsNull
true
if the input is nullObjectConverters.IsNotNull
false
if the input is nullBoolConverters.And
true
if all inputs are true.TextBlock
if the bound text is null or empty:ContentControl
if the bound content is null or empty: