Is there a way to share information between value converters ?
I initially thought about binding all the object and update the property once (I mean the Enum
) inside the value converter, but I prefer binding only the property (string
) and revaluate the Enum
locally, but if I could share it, that's would be great.
public object Convert(object value, Type targetType, object parameter, CultureInfo culture)
{
var fieldDescriptionPattern = FieldHelpers.GetDescriptionPattern((string)value); // <- Can I share it in multiple value converters : font weight, foreground, etc.?
if (_fieldDescriptionBrushes.TryGetValue(fieldDescriptionPattern, out Brush brush))
{
return brush;
}
return Brushes.Transparent;
}