2025-10-26 14:53:22 +01:00
|
|
|
using System;
|
|
|
|
|
using Microsoft.UI.Xaml;
|
|
|
|
|
using Microsoft.UI.Xaml.Controls;
|
|
|
|
|
using Wino.Mail.ViewModels.Data;
|
|
|
|
|
|
|
|
|
|
namespace Wino.Mail.WinUI.Controls.ListView;
|
|
|
|
|
|
|
|
|
|
public partial class WinoMailItemContainerStyleSelector : StyleSelector
|
|
|
|
|
{
|
|
|
|
|
public Style? ThreadStyle { get; set; }
|
|
|
|
|
public Style? MailItemStyle { get; set; }
|
|
|
|
|
protected override Style SelectStyleCore(object item, DependencyObject container)
|
|
|
|
|
{
|
|
|
|
|
if (item is MailItemViewModel) return MailItemStyle ?? throw new Exception($"Missing style for {nameof(MailItemViewModel)}");
|
2025-10-27 22:52:26 +01:00
|
|
|
if (item is ThreadMailItemViewModel)
|
|
|
|
|
return ThreadStyle ?? throw new Exception($"Missing style for {nameof(ThreadMailItemViewModel)}");
|
2025-10-26 14:53:22 +01:00
|
|
|
|
2025-11-14 18:51:48 +01:00
|
|
|
return base.SelectStyleCore(item, container);
|
2025-10-26 14:53:22 +01:00
|
|
|
}
|
|
|
|
|
}
|