Hi,
i need to apply convertor dynamically depending on the the conditions applied by user.
how do i do this.
i have a covetrtor class where i need to pass the configration set by user a parameter and bind this to a specific column mentoned in config.
how do i do it dynamically?
public class ValueToStringConverter :
IValueConverter
{
public object Convert(object value, Type targetType, object parameter, System.Globalization.CultureInfo
culture)
ReplacementRuleConfig obj = parameter as ReplacementRuleConfig
;
string[] strarr = obj.RuleExpression.Split(new char[] { '='
});
string
strColName = strarr[0];
strColVal = strarr[1];
string str = value as string
if (String
.IsNullOrEmpty(str))
return string
.Empty;
}
try
if
(str == strColVal)
return
obj.RuleReplacementString;
catch
str;
public object ConvertBack(object value, Type targetType, object parameter, System.Globalization.CultureInfo
Off the Column object where you would set the ValueConverter is a property called .ValueConverterParameter, so if you could use that to pass in the information