using Windows.UI.Xaml;
using Windows.UI.Xaml.Controls;

namespace PCUT.Models.Categories
{
    public class CategoryTemplateSelector : DataTemplateSelector
    {
        public DataTemplate CategoryTemplate { get; set; }
        public DataTemplate MetadataTypeTemplate { get; set; }
        public DataTemplate MetadataTemplate { get; set; }
        protected override DataTemplate SelectTemplateCore(object item)
        {
            switch (item)
            {
                case CategoryModel _:
                    return CategoryTemplate;
                case MetadataTypeModel _:
                    return MetadataTypeTemplate;
                case CategoryMetadataModel _:
                    return MetadataTemplate;
                default:
                    return null;
            }
        }
    }
}
