using CollectionViewDemos.Models;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace CollectionViewDemos.Controls
{
    internal class MonkeyDataTemplateSelector : DataTemplateSelector
    {
        public DataTemplate AmericanMonkey { get; set; }
        public DataTemplate OtherMonkey { get; set; }

        protected override DataTemplate OnSelectTemplate(object item, BindableObject container)
        {
            Monkey monkey = (Monkey)item;
            return monkey.Location.Contains("America") ? AmericanMonkey : OtherMonkey;
        }
    }
}
