public object ConvertBack(object value, Type targetType, object parameter, CultureInfo culture) { if (value == null) { if (parameter != null) { return((int)parameter); } return(new ValidationResult(false, "Cannot convert back null.")); } if (value.ToString() == "727 WYSI") { return(727); } if (parameter == null) { if (TypeConverters.TryParseInt(value.ToString(), out int result1)) { return(result1); } return(new ValidationResult(false, "Int format error.")); } TypeConverters.TryParseInt(value.ToString(), out int result2, int.Parse(parameter.ToString())); return(result2); }