Get the Source value in ConvertBack() method for IValueConverter implementation in WPF binding

前端 未结 5 1540
醉梦人生
醉梦人生 2021-01-02 12:05

I am binding a dependency property to textboxex in WPF. The property is a string that has some values separated by \'/\' (example: \"1/2/3/4\" ). I need to bind individual v

5条回答
  •  旧巷少年郎
    2021-01-02 12:45

    Would you be better off using an IMultiValueConverter and a MultiBinding?

    public interface IMultiValueConverter
    {
        object Convert(object[] values, Type targetType, object parameter, CultureInfo culture);
    
        object[] ConvertBack(object value, Type[] targetTypes, object parameter, CultureInfo culture);
    }
    

提交回复
热议问题