You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
29 lines
739 B
29 lines
739 B
using System;
|
|
using System.Globalization;
|
|
|
|
namespace LolApp.Resources.Converters
|
|
{
|
|
public class PlusOneConverter : IValueConverter
|
|
{
|
|
public object Convert(object value, Type targetType, object parameter, CultureInfo culture)
|
|
{
|
|
int i = -1;
|
|
try
|
|
{
|
|
i = (int)value;
|
|
}
|
|
catch (InvalidCastException e)
|
|
{
|
|
throw new InvalidCastException("PlusOneConverter : the value must be an int");
|
|
}
|
|
return i + 1;
|
|
}
|
|
|
|
public object ConvertBack(object value, Type targetType, object parameter, CultureInfo culture)
|
|
{
|
|
throw new NotImplementedException();
|
|
}
|
|
}
|
|
}
|
|
|