@@ -1094,6 +1094,22 @@ private void GridRecent_Loaded(object sender, RoutedEventArgs e)
10941094 Tools . SetFocusToGrid ( gridRecent ) ;
10951095 // if coming from explorer launch, and missing unity version, projectsource is still null?
10961096 if ( projectsSource != null ) SetStatus ( "Ready (" + projectsSource . Count + " projects)" ) ;
1097+
1098+ // use saved sort columns
1099+ if ( string . IsNullOrEmpty ( Settings . Default . currentSortColumn ) == false )
1100+ {
1101+ // check if that column exists in headers
1102+ foreach ( DataGridColumn column in gridRecent . Columns )
1103+ {
1104+ if ( column . Header . ToString ( ) == Settings . Default . currentSortColumn )
1105+ {
1106+ // TODO Project binding is to Title, not project
1107+ Settings . Default . currentSortColumn = Settings . Default . currentSortColumn . Replace ( "Project" , "Title" ) ;
1108+ gridRecent . Items . SortDescriptions . Add ( new SortDescription ( Settings . Default . currentSortColumn , Settings . Default . currentSortDirectionAscending ? ListSortDirection . Ascending : ListSortDirection . Descending ) ) ;
1109+ break ;
1110+ }
1111+ }
1112+ }
10971113 }
10981114
10991115 private void BtnExploreUnity_Click ( object sender , RoutedEventArgs e )
@@ -1885,7 +1901,7 @@ private void ChkStreamerMode_Checked(object sender, RoutedEventArgs e)
18851901 Style cellStyle = new Style ( typeof ( DataGridCell ) ) ;
18861902 cellStyle . Setters . Add ( new Setter ( FontSizeProperty , 1.0 ) ) ;
18871903 txtColumnTitle . CellStyle = isChecked ? cellStyle : null ;
1888- txtColumnName . CellStyle = isChecked ? cellStyle : null ;
1904+ txtColumnPath . CellStyle = isChecked ? cellStyle : null ;
18891905 txtColumnGitBranch . CellStyle = isChecked ? cellStyle : null ;
18901906
18911907 Style txtBoxStyle = new Style ( typeof ( TextBox ) ) ;
@@ -2915,7 +2931,6 @@ void SortHandlerUpdates(object sender, DataGridSortingEventArgs e)
29152931 {
29162932 DataGridColumn column = e . Column ;
29172933
2918- //Console.WriteLine("Sorted by " + column.Header);
29192934
29202935 IComparer comparer = null ;
29212936
@@ -2981,13 +2996,22 @@ void SortHandlerRecentProjects(object sender, DataGridSortingEventArgs e)
29812996
29822997 //Console.WriteLine("Sorted by " + column.Header);
29832998
2999+ // save current sort to prefs
3000+ Settings . Default . currentSortColumn = column . Header . ToString ( ) ;
3001+
29843002 IComparer comparer = null ;
29853003
29863004 // prevent the built-in sort from sorting
29873005 e . Handled = true ;
29883006
3007+ // load sort dir
3008+ column . SortDirection = Settings . Default . currentSortDirectionAscending ? ListSortDirection . Ascending : ListSortDirection . Descending ;
3009+
29893010 ListSortDirection direction = ( column . SortDirection != ListSortDirection . Ascending ) ? ListSortDirection . Ascending : ListSortDirection . Descending ;
29903011
3012+ // save
3013+ Settings . Default . currentSortDirectionAscending = direction == ListSortDirection . Ascending ;
3014+
29913015 //set the sort order on the column
29923016 column . SortDirection = direction ;
29933017
0 commit comments