Files
Phonebook/Converters/NullToBoolConverter.cs
2025-05-09 22:48:36 +03:00

21 lines
557 B
C#

using System.Globalization;
namespace Phonebook.Converters
{
public class NullToBoolConverter : IValueConverter
{
public object Convert(object value, Type targetType, object parameter, CultureInfo culture)
{
if (value is int intValue)
{
return intValue > 0;
}
return false;
}
public object ConvertBack(object value, Type targetType, object parameter, CultureInfo culture)
{
throw new NotImplementedException();
}
}
}