Resources, neither are
DataTemplatesare placed in a
DataTemplatescollection on each control (and on
DataTemplates can be important:
DataTemplates within the same collection are evaluated in declaration order so you need to place them from most-specific to least-specific as you would in code.
DataTemplateSelectorto select or create a
DataTemplatebased on the provided data. In Avalonia you cannot do this, but you can implement
IDataTemplatewhich can be seen as a good replacement for the
DataTemplateSelector. Please find a sample here.