using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Windows;

namespace WpfApp123
{
    public class NavigationItemContentTemplateSelector : System.Windows.Controls.DataTemplateSelector
    {
        public DataTemplate NavigationView { get; set; }
        public DataTemplate NavigationEmptyView { get; set; } = new DataTemplate();

        public override DataTemplate SelectTemplate(object item, DependencyObject container)
        {
            if (item is NavigationModel navigationItemModel)
            {
                switch (navigationItemModel.Code)
                {
                    case "view":
                        return NavigationView;
                    default:
                        return NavigationEmptyView;
                }
            }
            else
            {
                return NavigationEmptyView;
            }
        }
    }
}

