views:

298

answers:

1

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;
    }
}
A: 

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 :)

Simon Söderman
actually I think a snippet is more convenient than a template, since it provides editable fields...
Thomas Levesque
Yeah, I agree, but since it isn't what he asked for.. :)note to threadstarter: snippets rule! :)
Simon Söderman