Можно ли привязаться к полю ValueTuple в WPF с С # 7

Вы могли бы попробовать реализовать csharp преобразователь значений. Вот valuetuple пример ...

public class TupleDisplayNameConverter : IValueConverter
{
    public object Convert(object value, Type targetType, object parameter, CultureInfo culture)
    {
        var tuple = value as (Int32 Id, String Name)?;

        if (tuple == null)
            return null;

        return tuple.Value.Name;
    }

    public object ConvertBack(object value, Type targetType, object parameter, CultureInfo culture)
    {
        throw new NotSupportedException();
    }
}



Надеюсь, это поможет.

c#

wpf

xaml

valuetuple

2022-11-12T11:40:29+00:00