c# - Converters, sending a String and returning a int -
I have this converter that returns the number of the width of Why did this happen and what is the solution? I just change this line: to: textbox according to the number of characters (Value value, type target type, object parameter, cultureinfo culture) {string}: {valueConversion (typef (string), typef (int)) public class textdown: g = (string) value; Return g.Length * 10; } Public Object Convertback (type object type, type target type, object parameter, cultureinfo culture) {return tap; In the definition of a grid in the column, I tried to use this converter, but received an error in which the
IVALueConverter does not support converting with TypeConverter string. I know that
control: textbox hailer. Label is a string:
& lt; Column Definition Width = "{TemplateBinding Controls: TextboxHelper.Label, Converter = ToWidth}" />
& lt; Column Definition Width = "{TemplateBinding Controls: TextboxHelper.Label, Converter = ToWidth}" />
& lt; Column Definition Width = "{TemplateBinding Control: TextboxHelper.Label, Converter = {StaticResource ToWidth}}" />
Comments
Post a Comment