But notice something else: we had to switch the order of the StatusBarItems so that the first one fills the remaining space. This is because of the way WPF’s DockPanel works. The last item present in it will fill remaining space unless you tell it otherwise.

It’s a bit confusing having the second item first, and things get worse as we add more and more items. Moreover, we don’t have sufficient control over the proportional widths allocated to the status bar items.

We need more control over how the StatusBarItems are arranged. The key to this problem is that the StatusBar’s use of a DockPanel for StatusBarItem layout is a default only. Like most things WPF, it can be customised. We can do this via the StatusBar.ItemsPanel property. This is actually a property of the ItemsControl class, which StatusBar inherits from. However, StatusBar does override the default panel type, changing it from StackPanel to DockPanel.

For the ultimate control, I opted to use a Grid, WPF’s swiss army knife panel. For example:

Of course, being WPF you can add whatever you want to the status bar, including separators, images, or whatever. The point is, for more control over the layout of your StatusBarItems, you’ll want to swap out the default DockPanel for something with more oomph.