While the ToolBarTray tool does not contain the ItemsSource property, it contains the ToolBars property with which you could bind. And then each toolbar has an ItemsSource property that you could contact.
So your binding will look something like this:
<ToolBarTray ToolBars="{Binding MyToolBarsProperty}" />
Then you can start using HierarchicalDataTemplates in toolbars:
<HierarchicalDataTemplate.ItemContainerStyle>
<Style TargetType="Button">
<Setter Property="Command" Value="{Binding Command}"/>
</Style>
</HierarchicalDataTemplate.ItemContainerStyle>
source
share