title: Grouping of items in ListView WPF
body: <p>I have a ListView where I want to group the items based on a field of the item object. Below is the code I have:</p>
  
  <pre><code>&lt;ListView ItemsSource="{x:Bind MyVM.CollectionOfClassA, Mode=OneWay}"
      &lt;ListView.GroupStyle&gt;
          &lt;GroupStyle&gt;
              &lt;GroupStyle.HeaderTemplate&gt;
                  &lt;DataTemplate&gt;
                      &lt;TextBlock FontSize="15" FontWeight="Bold" Text="{Binding DateTimePropertyOfClassA}"/&gt;
                  &lt;/DataTemplate&gt;
              &lt;/GroupStyle.HeaderTemplate&gt;
          &lt;/GroupStyle&gt;
      &lt;/ListView.GroupStyle&gt;
  &lt;/ListView&gt;
  </code></pre>
  
  <p>Is there something I am missing? I want to group the items based on the DateTime property of ClassA objects. Also, if there is no item for any particular day, I would still like to show that date with empty list under that group (for that day). How can I achieve it? </p>
  
  <p>Edit: I am not able to use CollectionViewSource since my VM contains the collection of ClassA object (which is bound as item source to the listview) and I want to group the items based on one property of those ClassA objects. I am sure there is something I am missing out on. But I am not able to figure it out.</p>