VPet/VPet-Simulator.Windows/Design/Converters/BoolToIntConverter.cs

21 lines
530 B
C#
Raw Normal View History

2023-06-05 08:42:20 +00:00
using System;
using System.Globalization;
using System.Windows.Data;
namespace VPet_Simulator.Windows
{
public class BoolToIntConverter
: IValueConverter
{
public object Convert(object value, Type targetType, object parameter, CultureInfo culture)
{
return (value as bool?) == true ? 1 : 0;
}
public object ConvertBack(object value, Type targetType, object parameter, CultureInfo culture)
{
throw new NotImplementedException();
}
}
}