using MECF.Framework.Common.Aitex.Core.RT.EMS;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Windows;
using System.Windows.Controls;

namespace MECF.Framework.UI.Client.CenterViews.Maintain
{
    public class MaintainerDataTemplateSelector:DataTemplateSelector
    {
        public DataTemplate PlanMaintainerTemplate { get; set; }

        public DataTemplate PMMaintainerTemplate { get; set; }

        public DataTemplate PMCoatingMaintainerTemplate { get; set; }

        public override DataTemplate SelectTemplate(object item, DependencyObject container)
        {
            if (item is MaintainerInfo mitem)
            {
                if (mitem.Type == nameof(PresetMaintainer))
                    return PlanMaintainerTemplate;
                else if (mitem.Type == nameof(ProcessMaintainer))
                    return PMMaintainerTemplate;
                else if (mitem.Type == nameof(CoatingMaintainer))
                    return PMCoatingMaintainerTemplate;
            }

            return PlanMaintainerTemplate;
        }
    }
}
