using System;
using System.Windows;
using System.Windows.Data;
namespace Ravi.Infrastructure.Converters
{
public class CopnvertIntToBool : IValueConverter
{
#region Methods
public object Convert(object value, Type targetType, object parameter, System.Globalization.CultureInfo culture)
{
if(value == null || parameter == null)
return false;
return System.Convert.ToInt32(value) == System.Convert.ToInt32(parameter);
}
public object ConvertBack(object value, Type targetType, object parameter, System.Globalization.CultureInfo culture)
{
if(System.Convert.ToBoolean(value))
return System.Convert.ToInt32(parameter);
else
{
return DependencyProperty.UnsetValue;
}
}
#endregion Methods
}
}
