For simple xaml elements “inline” syntax where the property is an XML attribute is preferable:
<ListBox> <ListBox.ItemTemplate> <StaticResource ResourceKey="PathVisualTemplate"/> </ListBox.ItemTemplate> </ListBox>
For more complex elements, “Property Element Syntax” is preferable.
However, Property Element Syntax can also be used in the simple case too:
though this is less pretty than the inline form.