title: Visibility IValueConverter for ObservableCollection<T>
body: <p>I'd like to create a visibility converter which displays content if an observablecollection is empty or null. As this converter will be used on many screens, each collection will hold a different type (T).</p>
  
  <p>How do I get a reference to the ObservableCollection of unknown type. This is what I have so far:</p>
  
  <pre><code>public object Convert(object value, Type targetType, object parameter, System.Globalization.CultureInfo culture)
      {
        if (value == null) return Visibility.Visible;
        if (value is ObservableCollection&lt;object&gt;)
        {
          var col = value as ObservableCollection&lt;object&gt;;
          return col.Count &gt; 0 ? Visibility.Hidden : Visibility.Visible;
        }
        return Binding.DoNothing;
      }
  </code></pre>