26 lines
759 B
C#
26 lines
759 B
C#
using System;
|
|
using System.Globalization;
|
|
using System.Windows.Data;
|
|
|
|
namespace BeWo.Converter
|
|
{
|
|
[ValueConversion(typeof(int), typeof(bool))]
|
|
public class IndexBoolConverter : IValueConverter
|
|
{
|
|
public object Convert(object value, Type targetType, object parameter, CultureInfo culture)
|
|
{
|
|
int lIndex = -1;
|
|
if (parameter != null && parameter is string)
|
|
{
|
|
Int32.TryParse(parameter as string, out lIndex);
|
|
}
|
|
|
|
return ((int)value) != lIndex;
|
|
}
|
|
|
|
public object ConvertBack(object value, Type targetType, object parameter, CultureInfo culture)
|
|
{
|
|
throw new NotImplementedException();
|
|
}
|
|
}
|
|
} |