Question

I find myself creating Converters often and would like to be able to:

  • right-click on my Converters folder
  • Add New Item...
  • choose Converter Item Template

I found these instructions but I can imagine that there are templates for standard files like WPF Converters already available somewhere, does anyone know of any?

The following file would be created:

[ValueConversion(typeof(string), typeof(string))]
class SaveStatusToSaveStatusMessageConverter : IValueConverter
{
    public object Convert(object value, Type targetType, object parameter, System.Globalization.CultureInfo culture)
    {
        return value;
    }

    public object ConvertBack(object value, Type targetType, object parameter, System.Globalization.CultureInfo culture)
    {
        return value;
    }
}
Was it helpful?

Solution

the nerd+art snippets have a snippet called nerd_vc which generates a valueconverter for you. You can customize it to your liking, good luck!

http://www.blendables.com/files/folders/nerd_43_art/entry387.aspx

oh. sorry, i´m tired. what you want is not snippets.... I´ll leave the post here tough :)

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top