using Microsoft.VisualBasic;
using Services;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Windows;
using System.Windows.Controls;
using System.Windows.Data;
using System.Windows.Documents;
using System.Windows.Input;
using System.Windows.Media;
using System.Windows.Media.Imaging;
using System.Windows.Shapes;

namespace ReAct_PME
{
    public class MessageTemplateSelector : DataTemplateSelector
    {
        public DataTemplate IncomingTemplate { get; set; }
        public DataTemplate OutgoingTemplate { get; set; }

        public override DataTemplate SelectTemplate(object item, DependencyObject container)
        {
            if (item is MailMessageItem msg)
            {
                return msg.Direction == "in" ? IncomingTemplate : OutgoingTemplate;
            }
            return base.SelectTemplate(item, container);
        }
    }
    /// <summary>
    /// Logique d'interaction pour DetailEmailSend.xaml
    /// </summary>
    public partial class DetailEmailSend : Window
    {
        public ThreadItem SelectedItem { get; }

        public DetailEmailSend(ThreadItem selectedItem)
        {
            InitializeComponent();
            SelectedItem = selectedItem;
            DataContext = SelectedItem;
            this.Title = $"Détail de la conversation : {SelectedItem.Subject} - ({SelectedItem.DateMessageSTR})";
        }

        private void Button_Click(object sender, RoutedEventArgs e)
        {
            this.Close();
        }


    }
}
