Implements TypedDataTemplateSelector.