Moved the sorting outside of xaml