mirror of
https://github.com/wismna/ModernKeePass.git
synced 2025-10-03 15:40:18 -04:00
Sorting now works for entries (not yet for groups)
This commit is contained in:
@@ -183,12 +183,26 @@ namespace ModernKeePass.ViewModels
|
||||
|
||||
public void SortEntries()
|
||||
{
|
||||
var comparer = new PwEntryComparer(PwDefs.TitleField, true, true);
|
||||
var comparer = new PwEntryComparer(PwDefs.TitleField, true, false);
|
||||
try
|
||||
{
|
||||
// TODO: this throws an exception
|
||||
_pwGroup.Entries.Sort(comparer);
|
||||
Entries = new ObservableCollection<EntryVm>(Entries.OrderBy(e => e.Name));
|
||||
OnPropertyChanged("Entries");
|
||||
}
|
||||
catch (Exception e)
|
||||
{
|
||||
MessageDialogService.ShowErrorDialog(e);
|
||||
}
|
||||
}
|
||||
|
||||
public void SortGroups()
|
||||
{
|
||||
try
|
||||
{
|
||||
_pwGroup.SortSubGroups(false);
|
||||
Groups = new ObservableCollection<GroupVm>(Groups.Skip(1).OrderBy(g => g.Name));
|
||||
OnPropertyChanged("Groups");
|
||||
}
|
||||
catch (Exception e)
|
||||
{
|
||||
|
Reference in New Issue
Block a user