1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18
| public class EnSPVisible : IValueConverter {
public object Convert(object value, Type targetType, object parameter, System.Globalization.CultureInfo culture) {
int itype = -1;
if (value.GetType() == typeof(int)) {
itype = (int)value;
}
if (itype == 1 || itype == 2)
return System.Windows.Visibility.Visible;
else
return System.Windows.Visibility.Hidden;
}
public object ConvertBack(object value, Type targetType, object parameter, System.Globalization.CultureInfo culture) {
return 1;
}
} |