"wpf string to double converter" Code Answer

1

you do not need a converter for this, use the .tostring() method at the property.

public string graphpenwidthvalue { get { return this.graphpenwidth.tostring(); } }

anyway here is a standart string value converter:

 [valueconversion(typeof(object), typeof(string))]
    public class stringconverter : ivalueconverter
    {
        public object convert(object value, type targettype, object parameter, cultureinfo culture)
        {
            return value == null ? null : value.tostring();
        }

        public object convertback(object value, type targettype, object parameter, cultureinfo culture)
        {
            throw new notimplementedexception();
        }
    }
By jcreignou on January 5 2022

Answers related to “wpf string to double converter”

Only authorized users can answer the Search term. Please sign in first, or register a free account.