using System.Windows;
using System.Windows.Controls;
using Telerik.Windows.Controls;

namespace WpfApp99
{
    public class NavigationViewContentTemplateSelector : DataTemplateSelector
    {
        public DataTemplate ATemplate { get; set; }
        public DataTemplate BTemplate { get; set; }
        public DataTemplate CTemplate { get; set; }
        public DataTemplate EmptyTemplate { get; set; } = new DataTemplate();

        public override DataTemplate SelectTemplate(object item, DependencyObject container)
        {
            if(item is NavigationItemModel navigationItemModel)
            {
                switch (navigationItemModel.Title)
                {
                    case "UserControl A": return this.ATemplate;
                    case "UserControl B": return this.BTemplate;
                    case "UserControl C": return this.CTemplate;
                    default             : return this.EmptyTemplate;
                }
            }
            else
            {
                return this.EmptyTemplate;
            }

        }
    }

}
