mirror of
https://github.com/denglihong2007/CRSim
synced 2026-08-07 01:55:50 +08:00
22 lines
620 B
C#
22 lines
620 B
C#
using System.Globalization;
|
|
using System.Windows.Data;
|
|
|
|
namespace CRSim.ScreenSimulator.Converters
|
|
{
|
|
public class IntAddOneConverter : IValueConverter
|
|
{
|
|
public object Convert(object value, Type targetType, object parameter, CultureInfo culture)
|
|
{
|
|
if (value is int intValue)
|
|
return intValue + 1;
|
|
return value;
|
|
}
|
|
|
|
public object ConvertBack(object value, Type targetType, object parameter, CultureInfo culture)
|
|
{
|
|
if (value is int intValue)
|
|
return intValue - 1;
|
|
return value;
|
|
}
|
|
}
|
|
} |