Add configurable thread item sorting
This commit is contained in:
@@ -42,6 +42,12 @@ public partial class MessageListPageViewModel : MailBaseViewModel
|
||||
Translator.HoverActionOption_MoveJunk
|
||||
];
|
||||
|
||||
public List<string> ThreadItemSortingOptions { get; } =
|
||||
[
|
||||
Translator.SettingsThreadOrder_LastItemFirst,
|
||||
Translator.SettingsThreadOrder_FirstItemFirst
|
||||
];
|
||||
|
||||
public IMailItemDisplayInformation DemoPreviewMailItemInformation { get; } = new DemoMailItemDisplayInformation();
|
||||
|
||||
public MailListDisplayMode SelectedMailSpacingMode => availableMailSpacingOptions[selectedMailSpacingIndex];
|
||||
@@ -73,6 +79,19 @@ public partial class MessageListPageViewModel : MailBaseViewModel
|
||||
}
|
||||
}
|
||||
|
||||
private int selectedThreadItemSortingIndex;
|
||||
public int SelectedThreadItemSortingIndex
|
||||
{
|
||||
get => selectedThreadItemSortingIndex;
|
||||
set
|
||||
{
|
||||
if (SetProperty(ref selectedThreadItemSortingIndex, value) && value >= 0)
|
||||
{
|
||||
PreferencesService.IsNewestThreadMailFirst = value == 0;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
#region Properties
|
||||
private int leftHoverActionIndex;
|
||||
public int LeftHoverActionIndex
|
||||
@@ -128,6 +147,7 @@ public partial class MessageListPageViewModel : MailBaseViewModel
|
||||
rightHoverActionIndex = availableHoverActions.IndexOf(PreferencesService.RightHoverAction);
|
||||
selectedMailSpacingIndex = availableMailSpacingOptions.IndexOf(PreferencesService.MailItemDisplayMode);
|
||||
SelectedMarkAsOptionIndex = Array.IndexOf(Enum.GetValues<MailMarkAsOption>(), PreferencesService.MarkAsPreference);
|
||||
selectedThreadItemSortingIndex = PreferencesService.IsNewestThreadMailFirst ? 0 : 1;
|
||||
}
|
||||
|
||||
[RelayCommand]
|
||||
|
||||
Reference in New Issue
Block a user