title: Where to set the Converter for items of a collection in XAML
body: <p>I just made my first converter to convert from int to string. I have a combobox fill with integers(years) but if the value is 0 I want the combobox to show 'All'.</p>
  
  <p>This is my converter:</p>
  
  <pre><code>public class IntToString : IValueConverter
  {
       public object Convert(object value, Type targetType, object parameter, CultureInfo culture)
          {
              if (value != null)
              {
                  int intY = (int)value;
  
                  if (intY == 0)
                  {
                      String strY = "All";
                      return strY;
                  }
                  else
                  {
                      return intY.ToString();
                  }
              }
  
              return String.Empty;
          }
  
          public object ConvertBack(object value, Type targetType, object parameter, CultureInfo culture)
          {
  
          }
      }
  </code></pre>
  
  <p>In XAML where should I set the converter ? I tried in the ItemsSource of the combobox:</p>
  
  <pre><code>ItemsSource="{Binding YearsCollection, Converter={StaticResource intToStringYearConverter}}"
  </code></pre>
  
  <p>But I always get <code>InvalidcastException</code> on this line:</p>
  
  <pre><code>int intY = (int)value;
  </code></pre>