21 lines
565 B
C#
21 lines
565 B
C#
|
using System.Globalization;
|
||
|
|
||
|
namespace XiaoZhiSharp_MauiApp.Converters
|
||
|
{
|
||
|
public class IntToBoolConverter : 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();
|
||
|
}
|
||
|
}
|
||
|
}
|