internal Selector( Func <TemplateSelectorArgs <I>, DataTemplate> selectFunction, SelectorErrorStrategy errorStrategy) { ErrorStrategy = errorStrategy; this.selectFunction = selectFunction; }
public static DataTemplateSelector Create <I>( Func <TemplateSelectorArgs <I>, DataTemplate> selectFunction = null, SelectorErrorStrategy errorStrategy = SelectorErrorStrategy.ReturnNull) { switch (errorStrategy) { case SelectorErrorStrategy.ReturnNull: case SelectorErrorStrategy.ReturnNewEmptyDataTemplate: break; default: throw new ArgumentOutOfRangeException(nameof(errorStrategy)); } return(new Selector <I>(selectFunction, errorStrategy)); }