Dispenser/DispenserUI/ViewModels/Converter/StringNullOrEmptyToVisibili...

19 lines
537 B
C#
Raw Normal View History

2024-08-16 07:20:09 +00:00
using System;
using System.Globalization;
using Avalonia.Data.Converters;
namespace DispenserUI.ViewModels.Converter;
public class StringNullOrEmptyToVisibilityConverter : IValueConverter
{
public object Convert(object value, Type targetType, object parameter, CultureInfo culture)
{
var str = value as string;
return !string.IsNullOrEmpty(str);
}
public object ConvertBack(object value, Type targetType, object parameter, CultureInfo culture)
{
throw new NotImplementedException();
}
}