I have a WPF application with a ToolBarTray composed of a few ToolBar with tons of buttons. The only thing I want is for them to always be visible, no matter the size of the window.
<ToolBarTray>
<ToolBar OverflowMode="Never">
<userControls:SearchUserControl x:Name="SearchControl" />
</ToolBar>
<ToolBar ItemsSource="{Binding CommonCommands}" OverflowMode="Never"/>
<ToolBar ItemsSource="{Binding Type1Commands}" OverflowMode="Never"/>
<ToolBar ItemsSource="{Binding Type2Commands}" OverflowMode="Never" />
<ToolBar ItemsSource="{Binding Type3Commands}" OverflowMode="Never" />
</ToolBarTray>
I set OverflowMode="Never" to get rid of the little arrow on the right where buttons goes when there's not enough space since I always want all buttons visible. My "commands" list are RoutedCommand with a DataTemplate to show up as a button, but it react the same whatever I use.
If I put the ToolBarTray inside a StackPanel, their buttons/toolbars just continue past the window size. If I put the ToolBarTray inside a WrapPanel, instead of wrapping it hide the buttons completely (only the toolbar grip remains).
The comportment I would love to achieve is for toolbars to change their Band property dynamically so that if there's no space available, the toolbar switch to the second band (row) instead of hiding the buttons in their overflow panel.
Four years after the original question, but if I understand the problem correctly it is possible by adding the ToolBar controls in a WrapPanel instead of a ToolBarTray. The downside is that the functionality of the ToolBarTray such as moving ToolBars within the tray is lost, but if that is not a problem it works well otherwise.