I have a basic question regarding the usage of ConverterParameter. In the sense – I can always create a collection of types in my viewmodel and pass it to the converter during Binding.
And then in my convert method – I can do multiple if check statements and return accordingly
public object Convert(object value, Type targetType, object parameter, CultureInfo culture)
{
}
So the question is what exactly are the scenarios of using a ConverterParameter which just justifies it usage.
Please note – I am not asking how to use a ConverterParameter – i have done that – more interested when to use it
Here’s some of the cases where I used Converter parameter
represents specific class type. I used converter parameter to hold
the class type so I can control the conversion behavior based on the
parameter type.
parameter to define if It’s Departure date or arrival date to return
single string in the required format