Find a value in a comma delimited String Here is a simple WPF converter method designed, where the object is a string, and the parameters are a string, which contain a set of comma separated values. The program return true if the list has the value in and false otherwise. 

    public object Convert(object value, Type targetType, object parameter, CultureInfo culture)
    {
        try
        {
            string temp = parameter as string;
            List&lt;String&gt; list = temp.Split(',').ToList();
            string x = value as string;

            return list.Contains(x);
        }
        catch (Exception)
        {

            throw;
        }
    }


Why I am doing this

I was making a WPF Tab Controller, that looks at the type of objects that it can load and opens up different views based on that information. I cannot change the types of stations that are being supplied to me. Several of these stations share a view between all of them even though their type is different, I am using this converter in a Data Trigger in order to show the same view for this list of stations.

            &lt;DataTrigger Binding="{Binding StationState.StationType, Converter={StaticResource BindingInListConvertor}, ConverterParameter={StaticResource FinishingString}}" Value="True"&gt;
                &lt;Setter Property="ContentTemplate" Value="{StaticResource FinishingTemplate}" /&gt;
            &lt;/DataTrigger&gt;


The only other ways I could think of to do this are a multibinding data-trigger, or just a whole lot of them, and figured this would be best because the the possibility of future functionality.

This is my solution for it, is their a better/simpler/cooler way to acomplish this, thanks.
This could be a better/cooler way:

return (parameter as string)?.Split(',').Contains(value as string) ?? (object)false;


Your example is so short that I don't know what else I could say. You are looking for a short solution, so here is one.