Settings refactoring.
This commit is contained in:
@@ -1,8 +1,10 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.ComponentModel;
|
||||
using System.Threading.Tasks;
|
||||
using CommunityToolkit.Mvvm.Input;
|
||||
using Wino.Core.Domain;
|
||||
using Wino.Core.Domain.Entities.Shared;
|
||||
using Wino.Core.Domain.Enums;
|
||||
using Wino.Core.Domain.Interfaces;
|
||||
|
||||
@@ -40,6 +42,10 @@ public partial class MessageListPageViewModel : MailBaseViewModel
|
||||
Translator.HoverActionOption_MoveJunk
|
||||
];
|
||||
|
||||
public IMailItemDisplayInformation DemoPreviewMailItemInformation { get; } = new DemoMailItemDisplayInformation();
|
||||
|
||||
public MailListDisplayMode SelectedMailSpacingMode => availableMailSpacingOptions[selectedMailSpacingIndex];
|
||||
|
||||
private int selectedMarkAsOptionIndex;
|
||||
public int SelectedMarkAsOptionIndex
|
||||
{
|
||||
@@ -62,6 +68,7 @@ public partial class MessageListPageViewModel : MailBaseViewModel
|
||||
if (SetProperty(ref selectedMailSpacingIndex, value) && value >= 0 && value < availableMailSpacingOptions.Count)
|
||||
{
|
||||
PreferencesService.MailItemDisplayMode = availableMailSpacingOptions[value];
|
||||
OnPropertyChanged(nameof(SelectedMailSpacingMode));
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -135,4 +142,32 @@ public partial class MessageListPageViewModel : MailBaseViewModel
|
||||
_statePersistenceService.MailListPaneLength = 420;
|
||||
_dialogService.InfoBarMessage(Translator.GeneralTitle_Info, Translator.Info_MailListSizeResetSuccessMessage, InfoBarMessageType.Success);
|
||||
}
|
||||
|
||||
private sealed class DemoMailItemDisplayInformation : IMailItemDisplayInformation
|
||||
{
|
||||
public event PropertyChangedEventHandler PropertyChanged
|
||||
{
|
||||
add { }
|
||||
remove { }
|
||||
}
|
||||
|
||||
public string Subject => "Quarterly planning notes";
|
||||
public string FromName => "Ava Brooks";
|
||||
public string FromAddress => "ava@contoso.com";
|
||||
public string PreviewText => "Agenda draft, attendee updates, and a few follow-up items for this week.";
|
||||
public bool IsRead => false;
|
||||
public bool IsDraft => false;
|
||||
public bool HasAttachments => true;
|
||||
public bool IsCalendarEvent => false;
|
||||
public bool IsFlagged => true;
|
||||
public DateTime CreationDate => DateTime.Now.AddMinutes(-12);
|
||||
public Guid? ContactPictureFileId => null;
|
||||
public bool ThumbnailUpdatedEvent => false;
|
||||
public bool IsThreadExpanded => false;
|
||||
public AccountContact SenderContact => new()
|
||||
{
|
||||
Address = "ava@contoso.com",
|
||||
Name = "Ava Brooks"
|
||||
};
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user