title: WPF MVVM Custom Control issue
body: <p>I am trying to create a custom Tag Cloud control. The way I would like it to work is that the user can give it a collection of strings in the itemsSource and the converted string will be displayed in the UI. </p>
  
  <p>At the moment what I have is a tag cloud MVVM app which takes a collection strings (containing duplicates) and groups them by “Name” using a collectionView and then a converter is used to decide the FontSize of each string (tag) based on the count of that string.name in the original collection. </p>
  
  <p>So my question is how can I change this to my desired custom control? I know I will have to extend listbox in my code-behind to expose the itemsSource but the part I am confused about is what to do about the grouping logic (collectionView) as I am currently binding to a grouped collection (no duplicates) whereas I want the user to be able to provide any collection. Please let me know if this is clear.?</p>
  
  <p><strong>Grouping logic</strong></p>
  
  <pre><code>public class TagCloudControl : ListBox
  {
      public ObservableCollection&lt;TagModel&gt; Tags { get; set; }
  
      static TagCloudControl()
      {
          DefaultStyleKeyProperty.OverrideMetadata(typeof(TagCloudControl), new FrameworkPropertyMetadata
              (typeof(TagCloudControl)));
      }
  
      public static DependencyProperty tagsProperty = DependencyProperty.Register("tags",
          typeof(IEnumerable),
          typeof(TagCloudControl));
  
      public CollectionView GroupedTagsView { get; set; }
  
      public TagCloudControl()
      {
  
          ItemsSource = Tags;
  
          //group my labels by "name" property
          GroupedTagsView = (ListCollectionView)CollectionViewSource.GetDefaultView(Tags);
          GroupedTagsView.GroupDescriptions.Add(new PropertyGroupDescription("Name")); 
  
      }
  
      public IEnumerable tags
      {
          get { return (IEnumerable)GetValue(tagsProperty); }
          set { SetValue(tagsProperty, value); }
      }
  }
  </code></pre>