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

namespace Elwig.Controls {
    public class WineOriginTemplateSelector : DataTemplateSelector {
        public override DataTemplate SelectTemplate(object item, DependencyObject container) {
            ContentPresenter presenter = (ContentPresenter)container;
            if (presenter.TemplatedParent is ComboBox) {
                return (DataTemplate)presenter.FindResource("WineOriginTemplateCollapsed");
            } else {
                return (DataTemplate)presenter.FindResource("WineOriginTemplateExpanded");
            }
        }
    }
}
