title: WPF - Button IsEnabled Binding Converter
body: <p>I have an <code>ObservableCollection&lt;MyEntity&gt;</code> and <code>MyEntity</code> has a <code>IsChecked</code> property with a <code>PropertyChanged</code> event.
  I have a <code>Button</code> and I would like to change <code>IsEnabled</code> property to <code>true</code> when at least one of <code>MyEntity</code> of the <code>MyObservableCollection</code> is checked.
  I created a converter which takes the <code>ObservableCollection</code> and return true when a <code>MyEntity</code> is checked at least.
  But the <code>return "null"</code> is returned.
  What is wrong ? Thank you for your help.</p>
  
  <p>XAML</p>
  
  <pre><code>&lt;Window.Resources&gt;
      &lt;CollectionViewSource x:Key="MyObservableCollection"/&gt;
      &lt;src:MyConverter x:Key="MyConverter"/&gt;
  &lt;/Window.Resources&gt;
  &lt;Button IsEnabled="{Binding Converter={StaticResource MyConverter}, Source={StaticResource MyObservableCollection}}"/&gt;
  </code></pre>
  
  <p>C# Converter</p>
  
  <pre><code>class MyConverter : IValueConverter
  {
      public object Convert(object value, Type targetType, object parameter, CultureInfo culture)
      {
          if (null == value)
              return "null";
  
          ReadOnlyObservableCollection&lt;object&gt; items = (ReadOnlyObservableCollection&lt;object&gt;)value;
  
          List&lt;MyEntity&gt; myEntities = (from i in items select (MyEntity)i).ToList();
  
          foreach (MyEntity entity in myEntities)
          {
              if (entity.IsChecked)
              {
                  return true;
              }
          }
          return false;
      }
  
      public object ConvertBack(object value, Type targetType, object parameter, CultureInfo culture)
      {
          throw new System.NotImplementedException();
      }
  }
  </code></pre>