title: How to change WPF CollectionViewGroup type to custom type and use it in ListCollectionView
body: <p>How can override the type of View property to my custom type.
  My CustomGroupListCollectionView type adds extra property to the Groups property.
  During runtime when i observe the type of View property is ListCollectionView, i want to change this to CustomGroupListCollectionView.</p>
  
  <pre><code>public class CollectionViewSourceCustom : CollectionViewSource
  {
      public new  CustomGroupListCollectionView View { get; set; }
  }
  
  public class CustomGroupListCollectionView : ListCollectionView
  {
      private readonly CustomGroup _allGroup;
  
      public CustomGroupListCollectionView(IList list)
          : base(list)
      {
          _allGroup = new CustomGroup("All");
          foreach (var item in list)
          {
              _allGroup.AddItem(item);
          }
      }
  
      public override ReadOnlyObservableCollection&lt;object&gt; Groups
      {
          get
          {
              var group = new ObservableCollection&lt;object&gt;(base.Groups.ToList());
              group.Add(_allGroup);
              return new ReadOnlyObservableCollection&lt;object&gt;(group);
          }
      }
  }
  
  public class CustomGroup : CollectionViewGroup
  {
      public CustomGroup(object name)
          : base(name)
      {
      }
  
      public void AddItem(object item)
      {
          ProtectedItems.Add(item);
      }
  
      public override bool IsBottomLevel
      {
          get { return true; }
      }
  
      bool _IsChecked;
      public bool IsChecked
      {
          get { return _IsChecked; }
          set { _IsChecked = value; }
      }
      Visibility _CheckBoxVisibility;
      public Visibility CheckBoxVisibility
      {
          get { return _CheckBoxVisibility; }
          set { _CheckBoxVisibility = value; }
      }
  
      bool _IsExpanded;
      public bool IsExpanded
      {
          get { return _IsExpanded; }
          set { _IsExpanded = value; }
      }
      Visibility _ExpanderVisibility;
      public Visibility ExpanderVisibility
      {
          get { return _ExpanderVisibility; }
          set { _ExpanderVisibility = value; }
      }
  
      Visibility _ImageVisibility = Visibility.Collapsed;
      public Visibility ImageVisibility
      {
          get { return _ImageVisibility; }
          set { _ImageVisibility = value; }
      }
  } 
  </code></pre>