Skip to content

Commit

Permalink
Reset Glyph when Import and Export List is Refreshed
Browse files Browse the repository at this point in the history
  • Loading branch information
yangsfang committed Nov 7, 2021
1 parent 0d02949 commit 2f42353
Show file tree
Hide file tree
Showing 4 changed files with 23 additions and 1 deletion.
5 changes: 5 additions & 0 deletions DependenciesGui/DependencyExportList.xaml.cs
Original file line number Diff line number Diff line change
Expand Up @@ -63,5 +63,10 @@ private void ExportListCopySelectedValues(object sender, RoutedEventArgs e)
}
catch { }
}

public void ResetAutoSortProperty()
{
Wpf.Util.GridViewSort.RemoveSort(this.Items, this);
}
}
}
5 changes: 5 additions & 0 deletions DependenciesGui/DependencyImportList.xaml.cs
Original file line number Diff line number Diff line change
Expand Up @@ -83,5 +83,10 @@ private void ImportListCopySelectedValues(object sender, RoutedEventArgs e)
catch { }

}

public void ResetAutoSortProperty()
{
Wpf.Util.GridViewSort.RemoveSort(this.Items, this);
}
}
}
4 changes: 3 additions & 1 deletion DependenciesGui/DependencyWindow.xaml.cs
Original file line number Diff line number Diff line change
Expand Up @@ -1222,9 +1222,11 @@ private void UpdateImportExportLists(DisplayModuleInfo SelectedModule, DisplayMo
var machingImports = Parent.Imports.FindAll(imp => imp.Name == SelectedModule._Name);
this.ImportList.SetImports(SelectedModule.Filepath, SelectedModule.Exports, machingImports, SymPrv, this);
}
this.ImportList.ResetAutoSortProperty();

this.ExportList.SetExports(SelectedModule.Exports, SymPrv);
}
this.ExportList.ResetAutoSortProperty();
}
}

public PE LoadImport(string ModuleName, DisplayModuleInfo CurrentModule = null, bool DelayLoad = false)
Expand Down
10 changes: 10 additions & 0 deletions DependenciesGui/GridViewSort.cs
Original file line number Diff line number Diff line change
Expand Up @@ -253,6 +253,16 @@ public static void ApplySort(ICollectionView view, string propertyName, ListView
}
}

public static void RemoveSort(ICollectionView view, ListView listView)
{
view.SortDescriptions.Clear();
GridViewColumnHeader currentSortedColumnHeader = GetSortedColumnHeader(listView);
if (currentSortedColumnHeader != null)
{
RemoveSortGlyph(currentSortedColumnHeader);
}
}

private static void AddSortGlyph(GridViewColumnHeader columnHeader, ListSortDirection direction, ImageSource sortGlyph)
{
AdornerLayer adornerLayer = AdornerLayer.GetAdornerLayer(columnHeader);
Expand Down

0 comments on commit 2f42353

Please sign in to comment.