title: Sort ItemsControl from bottom to top
body: <p>I need this table to be listed from bottom to top. 0's should be at the bottom.
  Did a lot of google search, but the most suggestions I found are using ListBox or overriding the UniformGrid (which btw I also tried). Non of these suggestions worked for me.</p>
  
  <pre><code>&lt;Window x:Class="Double_ItemsControl.MainWindow"
          xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
          xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
          xmlns:local="clr-namespace:Double_ItemsControl"
          Title="MainWindow" Height="350" Width="525"&gt;
  
     &lt;Window.DataContext&gt;
          &lt;local:ViewModel /&gt;
     &lt;/Window.DataContext&gt;
  
     &lt;Grid&gt;
         &lt;ItemsControl ItemsSource="{Binding Path=OuterList}"&gt;
             &lt;ItemsControl.ItemTemplate&gt;
                 &lt;DataTemplate&gt;
                     &lt;ItemsControl ItemsSource="{Binding}"&gt;
                         &lt;ItemsControl.ItemsPanel&gt;
                             &lt;ItemsPanelTemplate&gt;
                                 &lt;UniformGrid Columns="1" /&gt;
                             &lt;/ItemsPanelTemplate&gt;
                         &lt;/ItemsControl.ItemsPanel&gt;
                         &lt;ItemsControl.ItemTemplate&gt;
                              &lt;DataTemplate&gt;
                                  &lt;TextBlock Text="{Binding}" VerticalAlignment="Center" HorizontalAlignment="Center" /&gt;
                              &lt;/DataTemplate&gt;
                         &lt;/ItemsControl.ItemTemplate&gt;
                     &lt;/ItemsControl&gt;
                 &lt;/DataTemplate&gt;
             &lt;/ItemsControl.ItemTemplate&gt;
             &lt;ItemsControl.ItemsPanel&gt;
                 &lt;ItemsPanelTemplate&gt;
                     &lt;UniformGrid Columns="6" /&gt;
                 &lt;/ItemsPanelTemplate&gt;
             &lt;/ItemsControl.ItemsPanel&gt;
         &lt;/ItemsControl&gt;
     &lt;/Grid&gt;
  </code></pre>
  
  <p></p>
  
  <pre><code>using System;
  using System.Collections.Generic;
  using System.Collections.ObjectModel;
  using System.Linq;
  using System.Text;
  using System.Threading.Tasks;
  
  namespace Double_ItemsControl
  {
      public class ViewModel
      {
          public ObservableCollection&lt;int&gt; InnerList { get; set; }
          public ObservableCollection&lt;ObservableCollection&lt;int&gt;&gt; OuterList { get; set; }
  
          public ViewModel()
          {
              InnerList = new ObservableCollection&lt;int&gt;() { 0,1,2,3,4 };
              OuterList = new ObservableCollection&lt;ObservableCollection&lt;int&gt;&gt;();
  
              for (int i = 1; i &lt; 35; i++)
              {
                   if (i % 5 == 0)
                   {
                       OuterList.Add(InnerList);
                   }
              } 
          }
      }
  }
  </code></pre>
  
  <p>any suggestions?</p>
  
  <p>BTW: I need to use two ItemControls.</p>