Source

main / Source / Excel / Excel.AddIn / Excel.AddIn / Helpers / ErrorPaneDataTemplateSelector.cs


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

namespace DataUp.Excel.Addin
{
    /// <summary>
    /// TODO: Update summary.
    /// </summary>
    public class ErrorPaneDataTemplateSelector : DataTemplateSelector
    {
        public DataTemplate SummaryTemplate { get; set; }
        public DataTemplate SheetTemplate { get; set; }

        public override DataTemplate SelectTemplate(object item, DependencyObject container)
        {
            if (item is SummaryViewModel)
            {
                return SummaryTemplate;
            }
            else
            {
                return SheetTemplate;
            }
        }
    }
}