Contacts, thread animation and image preview control improvements.

This commit is contained in:
Burak Kaan Köse
2026-02-09 22:39:30 +01:00
parent e559a79506
commit 0999c71578
26 changed files with 1636 additions and 756 deletions
@@ -2,14 +2,16 @@
using System.Collections.Generic;
using CommunityToolkit.Mvvm.ComponentModel;
using Wino.Core.Domain.Entities.Mail;
using Wino.Core.Domain.Entities.Shared;
using Wino.Core.Domain.Enums;
using Wino.Core.Domain.Interfaces;
namespace Wino.Mail.ViewModels.Data;
/// <summary>
/// Single view model for IMailItem representation.
/// </summary>
public partial class MailItemViewModel(MailCopy mailCopy) : ObservableRecipient, IMailListItem
public partial class MailItemViewModel(MailCopy mailCopy) : ObservableRecipient, IMailListItem, IMailItemDisplayInformation
{
[ObservableProperty]
[NotifyPropertyChangedFor(nameof(CreationDate))]
@@ -33,6 +35,7 @@ public partial class MailItemViewModel(MailCopy mailCopy) : ObservableRecipient,
[NotifyPropertyChangedFor(nameof(FolderId))]
[NotifyPropertyChangedFor(nameof(UniqueId))]
[NotifyPropertyChangedFor(nameof(Base64ContactPicture))]
[NotifyPropertyChangedFor(nameof(SenderContact))]
public partial MailCopy MailCopy { get; set; } = mailCopy;
[ObservableProperty]
@@ -58,6 +61,10 @@ public partial class MailItemViewModel(MailCopy mailCopy) : ObservableRecipient,
[ObservableProperty]
public partial bool IsBusy { get; set; }
public bool IsThreadExpanded => false;
public AccountContact SenderContact => MailCopy.SenderContact;
public DateTime CreationDate
{
get => MailCopy.CreationDate;
@@ -260,6 +267,7 @@ public partial class MailItemViewModel(MailCopy mailCopy) : ObservableRecipient,
OnPropertyChanged(nameof(FolderId));
OnPropertyChanged(nameof(UniqueId));
OnPropertyChanged(nameof(Base64ContactPicture));
OnPropertyChanged(nameof(SenderContact));
OnPropertyChanged(nameof(SortingDate));
OnPropertyChanged(nameof(SortingName));
}
@@ -4,14 +4,16 @@ using System.Collections.ObjectModel;
using System.Linq;
using CommunityToolkit.Mvvm.ComponentModel;
using Wino.Core.Domain;
using Wino.Core.Domain.Entities.Shared;
using Wino.Core.Domain.Enums;
using Wino.Core.Domain.Interfaces;
namespace Wino.Mail.ViewModels.Data;
/// <summary>
/// Thread mail item (multiple IMailItem) view model representation.
/// </summary>
public partial class ThreadMailItemViewModel : ObservableRecipient, IMailListItem
public partial class ThreadMailItemViewModel : ObservableRecipient, IMailListItem, IMailItemDisplayInformation
{
private readonly string _threadId;
private readonly HashSet<Guid> _uniqueIdSet = [];
@@ -150,6 +152,8 @@ public partial class ThreadMailItemViewModel : ObservableRecipient, IMailListIte
public bool ThumbnailUpdatedEvent => latestMailViewModel?.ThumbnailUpdatedEvent ?? false;
public AccountContact SenderContact => latestMailViewModel?.MailCopy?.SenderContact;
/// <summary>
/// Gets all emails in this thread (observable)
/// </summary>
@@ -177,6 +181,7 @@ public partial class ThreadMailItemViewModel : ObservableRecipient, IMailListIte
[NotifyPropertyChangedFor(nameof(FolderId))]
[NotifyPropertyChangedFor(nameof(UniqueId))]
[NotifyPropertyChangedFor(nameof(Base64ContactPicture))]
[NotifyPropertyChangedFor(nameof(SenderContact))]
public partial ObservableCollection<MailItemViewModel> ThreadEmails { get; set; } = [];
private MailItemViewModel latestMailViewModel => _cachedLatestMailViewModel;
@@ -260,6 +265,7 @@ public partial class ThreadMailItemViewModel : ObservableRecipient, IMailListIte
OnPropertyChanged(nameof(FolderId));
OnPropertyChanged(nameof(UniqueId));
OnPropertyChanged(nameof(Base64ContactPicture));
OnPropertyChanged(nameof(SenderContact));
OnPropertyChanged(nameof(ThumbnailUpdatedEvent));
OnPropertyChanged(nameof(SortingDate));
OnPropertyChanged(nameof(SortingName));