How to hierarchically sort data when clicking column headers in Gantt Chart Light Library

Gantt Chart Light Library includes sample applications showing the way we can hierarchically sort GanttChartItem objects based on their content (i.e. task name) when using the GanttChartDataGrid control, upon using an external ToggleButton. How can we update the code to hierarchically sort data based on specific properties and update user interface accordingly when clicking column headers instead?

An updated Sorting sample application for Silverlight™ has been prepared to show the way it could be done. It uses an updated template for column headers (based on the default Silverlight style) and provides hierarchical sorting behavior on clicking column headers as required. Note, however, that the source code may still be refactored as it was written just for demo purposes. For example, a section that could be improved is detecting which data property needs to be used to compare items when sorting upon clicking on a specific column header (currently we use a simple switch on the header text itself): Gantt Chart Silverlight Extended Sorting sample.