Initial commit.

This commit is contained in:
Burak Kaan Köse
2024-04-18 01:44:37 +02:00
parent 524ea4c0e1
commit 12d3814626
671 changed files with 77295 additions and 0 deletions

View File

@@ -0,0 +1,87 @@
using System.Collections.Generic;
using Wino.Core.Domain;
using Wino.Core.Domain.Enums;
using Wino.Core.Domain.Interfaces;
namespace Wino.Mail.ViewModels
{
public class MessageListPageViewModel : BaseViewModel
{
public IPreferencesService PreferencesService { get; }
private List<MailOperation> availableHoverActions = new List<MailOperation>
{
MailOperation.Archive,
MailOperation.SoftDelete,
MailOperation.SetFlag,
MailOperation.MarkAsRead,
MailOperation.MoveToJunk
};
public List<string> AvailableHoverActionsTranslations { get; set; } = new List<string>()
{
Translator.HoverActionOption_Archive,
Translator.HoverActionOption_Delete,
Translator.HoverActionOption_ToggleFlag,
Translator.HoverActionOption_ToggleRead,
Translator.HoverActionOption_MoveJunk
};
#region Properties
private int leftHoverActionIndex;
public int LeftHoverActionIndex
{
get => leftHoverActionIndex;
set
{
if (SetProperty(ref leftHoverActionIndex, value))
{
PreferencesService.LeftHoverAction = availableHoverActions[value];
}
}
}
private int centerHoverActionIndex;
public int CenterHoverActionIndex
{
get => centerHoverActionIndex;
set
{
if (SetProperty(ref centerHoverActionIndex, value))
{
PreferencesService.CenterHoverAction = availableHoverActions[value];
}
}
}
private int rightHoverActionIndex;
public int RightHoverActionIndex
{
get => rightHoverActionIndex;
set
{
if (SetProperty(ref rightHoverActionIndex, value))
{
PreferencesService.RightHoverAction = availableHoverActions[value];
}
}
}
#endregion
public MessageListPageViewModel(IDialogService dialogService,
IPreferencesService preferencesService) : base(dialogService)
{
PreferencesService = preferencesService;
leftHoverActionIndex = availableHoverActions.IndexOf(PreferencesService.LeftHoverAction);
centerHoverActionIndex = availableHoverActions.IndexOf(PreferencesService.CenterHoverAction);
rightHoverActionIndex = availableHoverActions.IndexOf(PreferencesService.RightHoverAction);
}
}
}